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<volatile int,a[1]>
> > 
> > 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.

Reply via email to