This is the mail archive of the
mailing list for the GCC project.
Re: C++ PATCH: PR 16405
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 1 Jan 2005 01:48:43 +0100
- Subject: Re: C++ PATCH: PR 16405
- References: <200412230812.iBN8CjP2028122@sethra.codesourcery.com> <email@example.com> <41CBBC15.firstname.lastname@example.org>
> 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