List of simplifications we should perform
Joseph S. Myers
jsm28@cam.ac.uk
Fri May 11 17:05:00 GMT 2001
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
jsm28@cam.ac.uk
More information about the Gcc
mailing list