This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
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