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


> The cast can't change the actual alignment of the underlying object.

Sure? ;-)

> 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.

-- 
Eric Botcazou


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