From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14106 invoked by alias); 5 Jan 2010 20:33:27 -0000 Received: (qmail 14051 invoked by uid 48); 5 Jan 2010 20:33:17 -0000 Date: Tue, 05 Jan 2010 20:33:00 -0000 Subject: [Bug tree-optimization/42625] New: -fipa-sra can generate different destructors in different object files, binary breaks after linking X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "zsojka at seznam dot cz" 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: 2010-01/txt/msg00572.txt.bz2 Tested revisions: r155643 - broken r155256 - broken r154886 - broken r154830 - OK Command line: in original testcases, all files are compiled with the same compiler parameters for this reduced testcase, one file is compiled with "-O1 -fipa-sra", second with just "-O1" if -fipa-sra is expected to generate the same code independently on where the function (destructor) is called from, I will open separate bugreport for that Output: g++ file1.cpp -O1 -fipa-sra -c && g++ file2.cpp -O1 -c && g++ file1.o file2.o && ./a.out a.out: header.h:8: Object::~Object(): Assertion `i == 1' failed. ============ header.h =========== #include struct Object { int a, i; Object() : i(1) {}; __attribute__((noinline)) ~Object() { assert(i == 1); } void del(); }; ============ file1.cpp ========== #include "header.h" int main() { delete new Object(); (new Object())->del(); return 0; } ============ file1.cpp ========== #include "header.h" void Object::del() { delete this; } ================================= -- Summary: -fipa-sra can generate different destructors in different object files, binary breaks after linking Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: zsojka at seznam dot cz GCC host triplet: x86_64-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42625