From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15220 invoked by alias); 10 Sep 2008 01:52:34 -0000 Received: (qmail 14822 invoked by uid 48); 10 Sep 2008 01:51:11 -0000 Date: Wed, 10 Sep 2008 01:52:00 -0000 Subject: [Bug c++/37452] New: -fPIC and inline seems to generate incorrect code with nested class templates X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "notquitezeus at gmail dot com" 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: 2008-09/txt/msg01177.txt.bz2 uname -a: Linux lit3n4014e 2.6.22.18-0.2-bigsmp #1 SMP 2008-06-09 13:53:20 +0200 i686 i686 i386 GNU/Linux OS is SuSE 10.3 IA32 on a Core2 Duo machine. See attachments for g++ -dumpspecs, pre-processed source that demonstrates the problem, assembly generated by g++ and (on the chance that it's useful) assembly generated by the latest version of Intel's compiler. There's a segfault on what gdb thinks is the first "real" line of PerformanceStatistics::Scope::~Scope(). The segfault also occurs in the same place if: 1) I replace lCycles = mCounter.GetElapsedTime() with lCycles = 0 2) I leave the line lCycles = mCounter.GetElapsedTime() untouched and instead comment out the rest of the if statement The problem only occurs when -fPIC and -finline are both enabled. I can compile with -O3 -fno-inline and the problem goes away or I can compile with -O0 -finline and the problem appears. -- Summary: -fPIC and inline seems to generate incorrect code with nested class templates Product: gcc Version: 4.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: notquitezeus at gmail dot com GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37452