This is the mail archive of the gcc@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: Wrong RTL instruction deleted


Robert Dewar <dewar@adacore.com> wrote:

>> Isn't this invalid code wrt aliasing?  Wouldn't you need to do
>
> I don't see the aliasing issue here. No pointers are involved.


Aliasing is about objects, not pointers. In the testcase, the code is accessing
an object of type "unsigned int" through a lvalue of type "float" and this is
undefined behaviour for the C++ standard. I guess -Wstrict-aliasing could be
improved to handle this situation if it does not already.

Giovanni Bajo


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