This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25152] -fstrict-aliasing generates wrong code, but no warning from -Wstrict-aliasing
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Nov 2005 17:47:00 -0000
- Subject: [Bug c++/25152] -fstrict-aliasing generates wrong code, but no warning from -Wstrict-aliasing
- References: <bug-25152-11785@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from pinskia at gcc dot gnu dot org 2005-11-29 17:47 -------
(In reply to comment #3)
> I know it breaks aliasing rules, but this problem was not present in gcc-3.3.
So ...
GCC 4.1 includes more optimization than 3.3 did which takes advantage of the
aliasing rules.
Note this is only undefined behavior. There are lots of undefined behavior
which we don't warn about. An example is signed overflow, if we warned about
that it would show up in the simple i++ or i = a + b example.
The warning was a bug which was filed a long time ago and was just only fixed.
Also I should note different targets would show up aliasing violating
differently. PPC will show more than x86 since the scheduler uses the
information and PPC relies more and than the shceduler than x86 does.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25152