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: More on VIEW_CONVERT_EXPR


Mark Mitchell writes:
 > Zack Weinberg wrote:
 > 
 > >Mark Mitchell <mark@codesourcery.com> writes:
 > >
 > >  
 > >
 > >>Richard Kenner wrote:
 > >>
 > >>    
 > >>
 > >>>I see VIEW_CONVERT_EXPR of type T applied to object X as meaning
 > >>>"treat object X as if it were type T".  That's why I see it more as
 > >>>a code 'r'.
 > >>>
 > >>>      
 > >>>
 > >>The documentation says  that this is like "*(type2 *)&X" in C.
 > >>
 > >>So, can it just be represented that way, on exit from the Ada front end?
 > >>    
 > >>
 > >
 > >Uh, *(type2 *)&X doesn't work in the general case due to the aliasing
 > >rules, whereas I get the impression V_C_E is expected to work always.
 > >  
 > >
 > Good point!
 > 
 > I'm not sure if there's a way around that.  I was just trying to think 
 > of a way to keep this on the front-end's side of the fence.

This provokes me to ask whether C/C++ aliasing rules are relevant to
the middle end, which is supposed to be able to handle many languages.
In a few places the Java front end does type conversions on pointers
and I suspect that these wouldn't all be legal C.

Andrew.


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