From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10570 invoked by alias); 11 Jun 2011 20:01:48 -0000 Received: (qmail 10551 invoked by uid 22791); 11 Jun 2011 20:01:48 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 11 Jun 2011 20:01:18 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5BK1HTZ029452 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 11 Jun 2011 16:01:17 -0400 Received: from [127.0.0.1] (ovpn-113-40.phx2.redhat.com [10.3.113.40]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p5BK1GlZ001651; Sat, 11 Jun 2011 16:01:16 -0400 Message-ID: <4DF3C98B.6070006@redhat.com> Date: Sun, 12 Jun 2011 07:58:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Richard Guenther CC: Richard Guenther , gcc-patches List , GCC Subject: Is VIEW_CONVERT_EXPR an lvalue? (was Re: RFA (fold): PATCH for c++/49290 (folding *(T*)(ar+10))) 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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00927.txt.bz2 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. And get_inner_reference handles it. So 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. Jason