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: C++ PATCH: PR 16405


> So, you are saying that you might have an expression, of an object type,
> with an alignment of (say) 2, but then apply some casts that give an
> alignment of 4? Why not just set the alignment correctly on the 
> original expression?  And, are these types really compatible, in the
> sense of the langhook?  Your point seems to be that you can't
> interchange the expressions; therefore, it seems, their types should not
> be considered compatible.

I was just saying that it is possible to run into counter-intuitive things 
with TYPE_ALIGN_OK, that is "casts" with the flag set that teach the 
middle-end to trust the front-end.  In Ada, these kinds of "casts" are 
represented with VIEW_CONVERT_EXPR nodes and used to implement polymorphism.

I agree that the transformation should be generically ok with the call to the 
langhook.

-- 
Eric Botcazou


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