optimization/4922: gcc-3.0.1 and 3.0.2 generate wrong code with -O2

jakub@gcc.gnu.org jakub@gcc.gnu.org
Thu Feb 21 08:39:00 GMT 2002


Synopsis: gcc-3.0.1 and 3.0.2 generate wrong code with -O2

State-Changed-From-To: open->closed
State-Changed-By: jakub
State-Changed-When: Thu Feb 21 08:11:12 2002
State-Changed-Why:
    This is not a bug in gcc, but in your code.
    Code like:
        inline UINT16* RowPos() { return (UINT16*) &nAddress; }
        *RowPos() = (UINT16) nRow;
    does not obey aliasing rules (the code is accessing
    nAddress both as 32-bit integer and 16-bit integer).
    Please read info gcc about -fstrict-aliasing.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4922



More information about the Gcc-bugs mailing list