How to not fold constants?

Stephen L Moshier moshier@mediaone.net
Tue Aug 10 05:41:00 GMT 1999


IEEE awareness rules in C9X require that floating point constant
expressions sometimes get folded and sometimes not.  For example, if
the expression occurs in executable code, it might not be folded; but
if it is a static initializer it would be folded.

It looks like c-parse.c makes up a tree containing the constant
expression and passes that tree to fold-const.c, without any indication
of the context where the expression came from in the source program.
Other functions also call fold-const.c and maybe they are not aware
of the context either.  The question is, how can fold-const.c figure
out whether the expression is a static initializer or is executable code?



More information about the Gcc mailing list