This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]