This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/42907] -fstrict-aliasing breaks valid code
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jan 2010 23:19:12 -0000
- Subject: [Bug c/42907] -fstrict-aliasing breaks valid code
- References: <bug-42907-18727@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #25 from steven at gcc dot gnu dot org 2010-01-30 23:19 -------
It should be consistent for programs that do not trigger undefined behavior.
The behavior of your program is undefined according to the C standard and
according to GCC.
The alias discussion is just one of th many where different crowds are asking
for different semantics for undefined behavior. But the point of "undefined" is
that, well, the behavior is undefined. So, although it is counterintuitive (and
in fact, quite unfriendly of the compiler) it is not incorrect to have
different program behavior at different optimization levels for a program with
undefined behavior.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42907