This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR middle-end/17793
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: jason at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 Oct 04 19:17:15 EDT
- Subject: Re: [PATCH] Fix PR middle-end/17793
VIEW_CONVERT_EXPR operates on the reference, NOP_EXPR on the value.
No. VIEW_CONVERT_EXPR conceptually operates on a *value*. In Ada, it's
the equivalent of an unchecked conversion, which is semantically a
*function*. In C, it's the equivalent of a conversion of a value into
a union and then an extraction of another field of that union, which
is also a value.
However, we also allow VIEW_CONVERT_EXPR is limited (and unfortunately,
presently ill-defined cases) within an RHS, in which case it does represent
a modification of the reference. But that is not the usual case, nor is
it the case we've been talking about in this thread.
Hmm, OK. I would expect gimplification of that example to create a
temporary for the NOP_EXPR.
True. Indeed it would in my example.
And in the case where it won't, stripping useless conversions should
have removed it. So I indeed don't understand how this case could
have occured. But even if it did, existing code should have handled it
just fine as a special case of the general way it operates.