This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFA (fold): PATCH for c++/49290 (folding *(T*)(ar+10))
- From: Richard Guenther <rguenther at suse dot de>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Richard Guenther <richard dot guenther at gmail dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>, GCC <gcc at gcc dot gnu dot org>
- Date: Tue, 14 Jun 2011 10:31:01 +0200 (CEST)
- Subject: Re: RFA (fold): PATCH for c++/49290 (folding *(T*)(ar+10))
- References: <4DEDB98F.6010508@redhat.com> <BANLkTimU_JPKgaqvhtb+m7fbDyTL340YJQ@mail.gmail.com> <4DEE2DCF.7020905@redhat.com> <BANLkTi=FX60RhEj2QF=t9MvkUCHR=D1m1A@mail.gmail.com> <4DEE3484.8030101@redhat.com> <4DF11FBC.3010304@redhat.com> <alpine.LNX.2.00.1106101029320.810@zhemvz.fhfr.qr> <4DF223D4.3080700@redhat.com> <alpine.LNX.2.00.1106101602530.810@zhemvz.fhfr.qr> <4DF22656.9050700@redhat.com> <alpine.LNX.2.00.1106101619070.810@zhemvz.fhfr.qr> <4DF3C98B.6070006@redhat.com> <BANLkTin8o9=mfL80u_MaWMSDyCYa61vdpQ@mail.gmail.com> <4DF5396B.6070502@redhat.com> <BANLkTiktV8ALouS2B2e5pLKQF3j4tSHB-w@mail.gmail.com> <4DF64E30.7020601@redhat.com>
On Mon, 13 Jun 2011, Jason Merrill wrote:
> On 06/13/2011 06:51 AM, Richard Guenther wrote:
> > But I suppose you want the array-ref be folded to a constant eventually?
>
> Right.
>
> I'm not going to keep arguing about VIEW_CONVERT_EXPR, but that brings me back
> to my original question: is it OK to add a permissive mode to the function, or
> should I copy the whole thing into the front end?
I think you should copy the whole thing into the front end for now.
Note that we want to arrive at a point where our constant folding
can handle the MEM_REF case for arbitrary constant constructors.
See fold_const_aggregate_ref in gimple-fold.c - probably not usable
from the frontend directly though. And it doesn't yet handle
non-array constructors without having a component-ref tree.
But if we eventually have all the code in that routine you might
switch to it instead.
Richard.