This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/32182] -fstrict-aliasing optimizations cause constructor not to run for object causing segfault
- From: "epperly2 at llnl dot gov" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jun 2007 20:53:13 -0000
- Subject: [Bug c++/32182] -fstrict-aliasing optimizations cause constructor not to run for object causing segfault
- References: <bug-32182-10468@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from epperly2 at llnl dot gov 2007-06-01 20:53 -------
To avoid depending on system #include files, the example has
typedef unsigned int size_t;
hardwired in the code. This may be an incorrect definition for some platforms.
Oddly enough, if I delete NextClass and make TestClass inherit directly from
BaseClass, the program no longer segfaults.
I am not sure if all the features of this example are strictly necessary. I
basically created a new program from scratch that has the same characteristics
as the original 100+K program, and I added things until it reproduced the same
behavior.
--
epperly2 at llnl dot gov changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|-fstrict-aliasing |-fstrict-aliasing
|optimizations cause |optimizations cause
|constructor not to run in |constructor not to run for
|causing segfault |object causing segfault
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32182