------- Comment #8 from rguenther at suse dot de 2009-01-28 19:44 ------- Subject: Re: [4.4 Regression] g++.dg/init/const7.C XFAILed
On Wed, 28 Jan 2009, jason at redhat dot com wrote: > 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. I'll bootstrap / test my fold patch. Richard. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38880