public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "notquitezeus at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/37452]  New: -fPIC and inline seems to generate incorrect code with nested class templates
Date: Wed, 10 Sep 2008 01:52:00 -0000	[thread overview]
Message-ID: <bug-37452-16687@http.gcc.gnu.org/bugzilla/> (raw)

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<enabled_domain>::Scope<enabled_domain::function_c>::~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


             reply	other threads:[~2008-09-10  1:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-10  1:52 notquitezeus at gmail dot com [this message]
2008-09-10  1:53 ` [Bug c++/37452] " notquitezeus at gmail dot com
2008-09-10  1:55 ` notquitezeus at gmail dot com
2008-09-10  1:56 ` notquitezeus at gmail dot com
2008-09-10  1:58 ` notquitezeus at gmail dot com
2008-09-10  2:00 ` notquitezeus at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-37452-16687@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).