From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14656 invoked by alias); 10 Jun 2011 14:20:42 -0000 Received: (qmail 14644 invoked by uid 22791); 10 Jun 2011 14:20:40 -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; Fri, 10 Jun 2011 14:20:25 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id D3F998738D; Fri, 10 Jun 2011 16:20:23 +0200 (CEST) Date: Fri, 10 Jun 2011 14:34:00 -0000 From: Richard Guenther To: Jason Merrill Cc: Richard Guenther , gcc-patches List Subject: Re: RFA (fold): PATCH for c++/49290 (folding *(T*)(ar+10)) In-Reply-To: <4DF22656.9050700@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> 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/msg00845.txt.bz2 On Fri, 10 Jun 2011, Jason Merrill wrote: > On 06/10/2011 10:03 AM, Richard Guenther wrote: > > > > *((volatile int *)&a[0] + 1) > > > > > > It would be correct to fold it to > > > > > > VIEW_CONVERT_EXPR > > > > No, it wouldn't be correct. It isn't correct to fold it to an array-ref > > that isn't volatile. > > Hmm? The C expression produces a volatile int lvalue referring to the second > element of a, as does the VIEW_CONVERT_EXPR. They seem equivalent to me. no, a VIEW_CONVERT_EXPR is generally not an lvalue (fold for example would turn the above to (volatile int) a[1]). Richard.