This is the mail archive of the
mailing list for the GCC project.
Re: C++ PATCH: PR 16405
> The cast can't change the actual alignment of the underlying object.
> Whatever alignment it has, it has. If the cast makes the alignment "2",
> when it's really "4", then the change I made is an optimization because
> it allows us to do the read more efficiently. If the cast makes the
> alignment "4", when it's really "2", then it's a lie, and the program
> was invalid.
Well, in Ada we have "aligning" nodes that explicitly step up the alignment of
an expression that is known to be over-aligned, but for which this can't be
deduced from the expression itself. Removing these nodes may lead to the
creation of unwanted temporaries later. See TYPE_ALIGN_OK.