This is the mail archive of the gcc@gcc.gnu.org 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]

How to not fold constants?



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?


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