public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "austern at apple dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/14639] New: Incorrect emission of unused compiler-generated destructor at -O2
Date: Thu, 18 Mar 2004 20:46:00 -0000	[thread overview]
Message-ID: <20040318204634.14639.austern@apple.com> (raw)

Consider the following file:
class AAA {
public:
  virtual ~AAA();
};

class BBB {
public:
  virtual ~BBB();
};

class xyz : public AAA, public BBB {
public:
  xyz() : AAA(), BBB() { }
};




Class xyz has no key method, so its vtable should be emitted only in translation units where it's used.  
With "gcc -O0 -c foo.cc" I get what I expect: the compiler doesn't emit _ZTV3xyz, _ZN3xyzD0Ev, or 
anything else.  With "gcc -O2 -c foo.cc" I get incorrect behavior: the compiler emits xyz's destructor 
and vtable, thunks, and all of the things in AAA and BBB that are required to support them.

This is a regression.  In 3.2.2, O0 and O2 both behave correctly.

-- 
           Summary: Incorrect emission of unused compiler-generated
                    destructor at -O2
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: austern at apple dot com
                CC: gcc-bugs at gcc dot gnu dot org
 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=14639


             reply	other threads:[~2004-03-18 20:46 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-18 20:46 austern at apple dot com [this message]
2004-03-19  1:33 ` [Bug c++/14639] [3.4/3.5 Regression] [unit-at-a-time] " pinskia at gcc dot gnu dot org
2004-03-19  2:27 ` mmitchel at gcc dot gnu dot org
2004-03-19  4:02 ` austern at apple dot com
2004-03-19  4:44 ` mark at codesourcery dot com
2004-03-21 18:26 ` [Bug c++/14639] New: " Jan Hubicka
2004-03-21 19:25   ` Mark Mitchell
2004-03-22  9:44     ` Jan Hubicka
2004-03-22 15:31       ` Mark Mitchell
2004-03-23  9:52         ` Jan Hubicka
2004-03-21 18:26 ` [Bug c++/14639] [3.4/3.5 Regression] [unit-at-a-time] " hubicka at ucw dot cz
2004-03-21 19:25 ` mark at codesourcery dot com
2004-03-21 23:33 ` steven at gcc dot gnu dot org
2004-03-22  9:44 ` jh at suse dot cz
2004-03-22 15:32 ` mark at codesourcery dot com
2004-03-23  9:52 ` jh at suse dot cz
2004-03-23 21:25 ` mark at codesourcery dot com
2004-03-23 21:26 ` mmitchel at gcc dot gnu dot org
2004-03-23 21:26 ` mmitchel at gcc dot gnu dot org
2004-03-24 18:23 ` hubicka at ucw dot cz
2004-03-24 18:44 ` mark at codesourcery dot com
2004-03-24 23:51 ` hubicka at ucw dot cz
2004-03-26  8:23 ` mark at codesourcery dot com
2004-03-26 10:01 ` hubicka at ucw dot cz
2004-03-28 15:42 ` cvs-commit at gcc dot gnu dot org
2004-03-30 13:46 ` [Bug c++/14639] [3.5 " pinskia at gcc dot gnu dot org
2004-06-03 23:27 ` bowdidge at apple dot com
2004-06-03 23:33 ` pinskia at gcc dot gnu dot org
2004-06-03 23:35 ` pinskia at gcc dot gnu dot org
2004-06-03 23:38 ` mark at codesourcery dot com
2004-06-03 23:38 ` bowdidge at apple dot com
2004-06-03 23:45 ` cvs-commit at gcc dot gnu dot org
2004-06-03 23:46 ` pinskia at gcc dot gnu dot org
2004-06-04  0:37 ` bowdidge at apple dot com
2004-06-04  0:38 ` bowdidge at apple dot com
2004-06-04  0:40 ` pinskia at gcc dot gnu dot org
2004-06-04  0:50 ` [Bug c++/14639] [3.5 Regression] [non-unit-at-a-time] " pinskia at gcc dot gnu dot org
2004-06-04  0:58 ` [Bug c++/14639] [3.5 Regression] [non-unit-at-a-time] Incorrect emission of unused compiler-generated destructor bowdidge at apple dot com
2004-06-04  1:09 ` pinskia at gcc dot gnu dot org
2004-06-04  1:50 ` pinskia at gcc dot gnu dot org
2004-06-04  2:12 ` bowdidge at apple dot com
2004-06-04  2:19 ` pinskia at gcc dot gnu dot org
2004-06-04  2:20 ` pinskia at gcc dot gnu dot org
2004-06-04  2:47 ` pinskia at gcc dot gnu dot org
2004-06-04  3:45 ` bowdidge at apple dot com
2004-06-04  4:53 ` bowdidge at apple dot com
2004-06-04  4:58 ` pinskia at gcc dot gnu dot org
2004-06-04 19:13 ` bowdidge at apple dot com
2004-06-04 21:04 ` hubicka at ucw dot cz
2004-06-04 21:11 ` hubicka at ucw dot cz
2004-06-04 21:15 ` bowdidge at apple dot com
2004-06-04 21:16 ` hubicka at ucw dot cz
2004-06-04 21:54 ` bowdidge at apple dot com
2004-06-04 22:59 ` bowdidge at apple dot com
2004-06-05  0:58 ` bowdidge at apple dot com
2004-06-05  1:02 ` bowdidge at apple dot com
2004-06-05  1:19 ` pinskia at gcc dot gnu dot org
2004-06-14 23:56 ` pinskia at gcc dot gnu dot org
2004-06-15  3:43 ` pinskia at gcc dot gnu dot org
2004-06-15 20:52 ` cvs-commit at gcc dot gnu dot org
2004-06-15 20:52 ` pinskia at gcc dot gnu dot org
2004-07-29 18:09 ` pinskia at gcc dot gnu dot org

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=20040318204634.14639.austern@apple.com \
    --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).