From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5072 invoked by alias); 1 Jun 2007 20:53:22 -0000 Received: (qmail 5046 invoked by uid 48); 1 Jun 2007 20:53:13 -0000 Date: Fri, 01 Jun 2007 20:53:00 -0000 Message-ID: <20070601205313.5045.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/32182] -fstrict-aliasing optimizations cause constructor not to run for object causing segfault In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "epperly2 at llnl dot gov" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-06/txt/msg00053.txt.bz2 ------- 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