This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: List of simplifications we should perform

On 11 May 2001, Tom Tromey wrote:

> Java has fairly strict rules about what can, cannot, and must be
> folded.  Right now fold() violates some of these rules.  We'll
> probably have to write our own fold() for Java, which is a shame.

ISO C has fairly strict rules about what an "integer constant expression"  
is.  GCC does not currently implement them properly.  Some constant
folding is effectively required by the standard, but other constant
folding is an optimization only and should not construct integer constant
expressions.  To complicate matters, correctly implementing these rules
will require __extension__ to make integer constant expressions out of
what wouldn't otherwise be integer constant expressions, since offsetof
needs to be one.  Also, the additional forms of constant expressions
accepted in initializers (which is where ISO C allows an implementation to 
accept additional forms, as long as they don't violate the constraints) - 
such as constant differences between addresses in the same object - need 
to be documented and to continue to be accepted.

Joseph S. Myers

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]