------- Comment #7 from jason at redhat dot com  2009-01-28 16:29 -------
Subject: Re:  [4.4 Regression] g++.dg/init/const7.C XFAILed

rguenther at suse dot de wrote:
>> Why do it in the FE?  This seems like a language-independent optimization.
> 
> Do it in the FE if the FE wants it to be optimized to a constant.
> Otherwise sure - it is a language-independent optimization.  But fold
> isn't a proper optimizer ;)

I don't understand the distinction you're making; it seems to me that 
reducing expressions to simpler forms that are more easily optimized is 
exactly what fold is for.  I don't see the difference between this and, 
say, reducing "1 + 2" to "3".

The FE doesn't especially want this to be a constant; it isn't a valid 
constant expression in C++, because it involves a subtraction of two 
pointers.

Jason


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38880

Reply via email to