This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
How to not fold constants?
- To: gcc@gcc.gnu.org
- Subject: How to not fold constants?
- From: Stephen L Moshier <moshier@mediaone.net>
- Date: Tue, 10 Aug 1999 08:40:54 -0400 (EDT)
- Reply-To: moshier@mediaone.net
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?