This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to not fold constants?
- To: moshier@mediaone.net
- Subject: Re: How to not fold constants?
- From: Jeffrey A Law <law@cygnus.com>
- Date: Tue, 10 Aug 1999 22:35:19 -0600
- cc: Toon Moene <toon@moene.indiv.nluug.nl>, gcc@gcc.gnu.org
- Reply-To: law@cygnus.com
In message <Pine.LNX.4.05.9908102002570.16852-100000@moshier.ne.mediaone.net>
you write:
>
> > It's not clear from your mail what the C9X standard requires
>
> The C9X rule says, roughly speaking, that float constant expressions
> may be folded only if nothing can possibly go wrong. It goes on to
> say that not ever folding at all is an acceptable way to implement
> that rule -- except for the case of static initializations.
>
> So I am asking, how do we figure out that an expression is a
> static initializer?
I'm not aware of any such way off the top of my head. You may need to create
one, probably by extending "fold" to accept and pass through an argument
which indicates that you're trying to fold an initializer. Then change the
callers in an appropriate manner.
jeff