From: Jason Merrill <jason@redhat.com>
To: gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: C++ PATCH for c++/49568 (unneeded thunks emitted on xcoff target)
Date: Wed, 06 Jul 2011 21:24:00 -0000 [thread overview]
Message-ID: <4E14D1B6.7090408@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 290 bytes --]
This issue was exposed by honza's change to how thunks are represented,
but the underlying problem was that we weren't setting DECL_COMDAT on
them properly.
Tested that the bug is fixed with an alpha-dec-osf5.1b cross compiler,
regression tested x86_64-pc-linux-gnu, applying to trunk.
[-- Attachment #2: 49568.patch --]
[-- Type: text/x-patch, Size: 1375 bytes --]
commit d8a77afc071a28ee411d484793b90aaf6959cc5f
Author: Jason Merrill <jason@redhat.com>
Date: Wed Jul 6 16:28:34 2011 -0400
PR c++/49568
* method.c (make_thunk, use_thunk): Copy DECL_COMDAT.
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 9b9eb9a..d41a4dd 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -140,11 +140,12 @@ make_thunk (tree function, bool this_adjusting,
THUNK_VIRTUAL_OFFSET (thunk) = virtual_offset;
THUNK_ALIAS (thunk) = NULL_TREE;
- /* The thunk itself is not a constructor or destructor, even if
- the thing it is thunking to is. */
DECL_INTERFACE_KNOWN (thunk) = 1;
DECL_NOT_REALLY_EXTERN (thunk) = 1;
+ DECL_COMDAT (thunk) = DECL_COMDAT (function);
DECL_SAVED_FUNCTION_DATA (thunk) = NULL;
+ /* The thunk itself is not a constructor or destructor, even if
+ the thing it is thunking to is. */
DECL_DESTRUCTOR_P (thunk) = 0;
DECL_CONSTRUCTOR_P (thunk) = 0;
DECL_EXTERNAL (thunk) = 1;
@@ -342,6 +343,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
DECL_VISIBILITY (thunk_fndecl) = DECL_VISIBILITY (function);
DECL_VISIBILITY_SPECIFIED (thunk_fndecl)
= DECL_VISIBILITY_SPECIFIED (function);
+ DECL_COMDAT (thunk_fndecl) = DECL_COMDAT (function);
if (DECL_ONE_ONLY (function) || DECL_WEAK (function))
make_decl_one_only (thunk_fndecl, cxx_comdat_group (thunk_fndecl));
reply other threads:[~2011-07-06 21:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4E14D1B6.7090408@redhat.com \
--to=jason@redhat.com \
--cc=gcc-patches@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).