This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11973] GCC 3.3 optimizer creates wrong code (i386/Linux)
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Aug 2003 21:55:32 -0000
- Subject: [Bug c++/11973] GCC 3.3 optimizer creates wrong code (i386/Linux)
- References: <20030818211447.11973.yuri@tsoft.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11973
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
------- Additional Comments From bangerth at dealii dot org 2003-08-18 21:55 -------
Your code is invalid. What you do is this:
- in new a->X_alc() you call C::operator new, which returns a C* which you later access
- however, C::operator new calls alc(), which returns the memory location of an object
which the compiler assumes is of type SList
Such type games violate C++'s type aliasing rules. The solution is either to fix your
code, or if you want to play hide-and-seek with the compiler, use -fno-strict-aliasing.
W.