On Mon, 4 Jun 2012, Manuel López-Ibáñez wrote:

> Well, the CPP macros could be translated to builtin calls and
> evaluated by the middle-end during or after gimplification. Then the
> FE would be really independent of the back-end. Sounds crazy?
Integer constant expressions from C standard headers - including limits.h, 
stdint.h etc., which in turn use predefined macros - are required to be 
usable in #if conditionals, so you need target-specific information 
(presently from target macros, hopefully from hooks in future) simply to 
preprocess.  The front end also needs in general to determine the values 
of integer constant expressions - which may involve sizeof, aligof, 
offsetof, so can depend in various ways on target-specific type layout - 
in order to determine whether code is valid (constant array sizes must be 
positive, for example) and indeed to determine the types of other 
expressions (if one half of a conditional expression is an integer 
constant expression cast to (void *), the type of the expression depends 
on whether that expression has value 0 and so the cast results in a null 
pointer constant).  So there are certainly target dependencies in things 
that are naturally the responsibility of the front end, even when you 
restrict yourself to building standard C.  Outside standard C, you of 
course have such things as target-specific types (e.g. __float128, 
__fpreg), declarations with "mode" attributes and target-specific built-in 
functions (where again the front end needs to know the types involved).

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to