From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16167 invoked by alias); 12 Jun 2011 11:00:11 -0000 Received: (qmail 16150 invoked by uid 22791); 12 Jun 2011 11:00:10 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 12 Jun 2011 10:59:57 +0000 Received: by wye20 with SMTP id 20so3167465wye.20 for ; Sun, 12 Jun 2011 03:59:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.55.67 with SMTP id t3mr3928220wbg.90.1307876395688; Sun, 12 Jun 2011 03:59:55 -0700 (PDT) Received: by 10.227.28.69 with HTTP; Sun, 12 Jun 2011 03:59:55 -0700 (PDT) In-Reply-To: <4DF3C98B.6070006@redhat.com> 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> Date: Sun, 12 Jun 2011 13:18:00 -0000 Message-ID: Subject: Re: Is VIEW_CONVERT_EXPR an lvalue? (was Re: RFA (fold): PATCH for c++/49290 (folding *(T*)(ar+10))) From: Richard Guenther To: Jason Merrill Cc: Richard Guenther , gcc-patches List , GCC Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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/msg00935.txt.bz2 On Sat, Jun 11, 2011 at 10:01 PM, Jason Merrill wrote: > On 06/10/2011 10:20 AM, Richard Guenther wrote: >> >> no, a VIEW_CONVERT_EXPR is generally not an lvalue (fold for example >> would turn the above to (volatile int) a[1]). > > The gimplifier seems to consider it an lvalue: gimplify_expr uses > gimplify_compound_lval for it, and gimplify_addr_expr handles taking its > address. =A0And get_inner_reference handles it. =A0So I think fold should= be > changed, and we should clarify that VIEW_CONVERT_EXPR is an lvalue. > > If not, we need a new tree code for treating an lvalue as an lvalue of a > different type without having to take its address; that's what I thought > VIEW_CONVERT_EXPR was for. The please provide a specification on what a VIEW_CONVERT_EXPR does to type-based alias analysis. We are trying to avoid that by the rvalue ru= le. Also you can always avoid VIEW_CONVERT_EXPRs for lvalues by simply moving the conversion to the rvalue side. Yes, we do handle lvalue VIEW_CONVERT_EXPRs, but that is for Ada which uses it for aggregates. I don't want us to add more lvalue VIEW_CONVERT_EXPR cases, especially not for register types. Richard. > Jason >