[Bug c/63803] When GCC 4.9.2 compile with option -O2, the target is error.

ktkachov at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 10 11:18:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63803

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktkachov at gcc dot gnu.org

--- Comment #4 from ktkachov at gcc dot gnu.org ---
The problem here is that the code uses undefined behaviour according to the C
standard (dereferencing NULL pointer), therefore the compiler is free to do
whatever it wants. The user code should be fixed to not do that.

GCC 4.9 is free to change its behaviour from 4.8 in such code because it makes
(and shouldn't make) no guarantees about undefined behaviour



More information about the Gcc-bugs mailing list