From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18682 invoked by alias); 14 Jun 2011 08:31:18 -0000 Received: (qmail 18665 invoked by uid 22791); 14 Jun 2011 08:31:16 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Jun 2011 08:31:02 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 5169C86391; Tue, 14 Jun 2011 10:31:01 +0200 (CEST) Date: Tue, 14 Jun 2011 09:10:00 -0000 From: Richard Guenther To: Jason Merrill Cc: Richard Guenther , gcc-patches List , GCC Subject: Re: RFA (fold): PATCH for c++/49290 (folding *(T*)(ar+10)) In-Reply-To: <4DF64E30.7020601@redhat.com> Message-ID: References: <4DEDB98F.6010508@redhat.com> <4DEE2DCF.7020905@redhat.com> <4DEE3484.8030101@redhat.com> <4DF11FBC.3010304@redhat.com> <4DF223D4.3080700@redhat.com> <4DF22656.9050700@redhat.com> <4DF3C98B.6070006@redhat.com> <4DF5396B.6070502@redhat.com> <4DF64E30.7020601@redhat.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg01015.txt.bz2 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.