public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at ucw dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/49568] [4.7 regression] g++.dg/torture/pr41257-2.C FAILs to link on Tru64 UNIX
Date: Fri, 01 Jul 2011 09:32:00 -0000	[thread overview]
Message-ID: <bug-49568-4-jQcabvG3fr@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-49568-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49568

--- Comment #6 from Jan Hubicka <hubicka at ucw dot cz> 2011-07-01 09:30:41 UTC ---
> This is Tru64 UNIX with ECOFF, no named sections, no COMDAT groups.
Yep, I know, but the question is how absence of COMDAT groups changes behaviour
of thunks.

The problem here is that the thunks are
!cgraph_can_remove_if_no_direct_calls_and_refs_p
and thus we don't optimize them out.
The reason is the test:
2902      if (node->local.externally_visible
2903          && (!DECL_COMDAT (node->decl)
2904              || cgraph_used_from_object_file_p (node)))
2905        return false;

the decl is not comdat, just weak and thus we think we must keep it in program.

The declaration of the destructor itself do have COMDAT flag.
The following patch should fix the problem:
Index: ipa.c
===================================================================
--- ipa.c       (revision 175748)
+++ ipa.c       (working copy)
@@ -871,9 +871,9 @@ function_and_variable_visibility (bool w

             We also need to arrange the thunk into the same comdat group as
             the function it reffers to.  */
+          DECL_COMDAT (node->decl) = DECL_COMDAT (decl_node->decl);
          if (DECL_ONE_ONLY (decl_node->decl))
            {
-             DECL_COMDAT (node->decl) = DECL_COMDAT (decl_node->decl);
              DECL_COMDAT_GROUP (node->decl) = DECL_COMDAT_GROUP
(decl_node->decl);
              if (DECL_ONE_ONLY (decl_node->decl) && !node->same_comdat_group)
                {


Jason, the whole code copying visibilities to thunk decls is just a hack.  Do
you think
you can make C++ FE to put proper visibility flags on thunks and same body
aliases?

Honza


  parent reply	other threads:[~2011-07-01  9:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-28 17:38 [Bug c++/49568] New: " ro at gcc dot gnu.org
2011-06-28 17:39 ` [Bug c++/49568] " ro at gcc dot gnu.org
2011-06-28 17:40 ` ro at gcc dot gnu.org
2011-06-29  9:44 ` rguenth at gcc dot gnu.org
2011-06-29 18:10 ` jason at gcc dot gnu.org
2011-07-01  8:41 ` hubicka at ucw dot cz
2011-07-01  8:49 ` ro at CeBiTec dot Uni-Bielefeld.DE
2011-07-01  9:32 ` hubicka at ucw dot cz [this message]
2011-07-01 10:04 ` ro at CeBiTec dot Uni-Bielefeld.DE
2011-07-01 21:11 ` jason at gcc dot gnu.org
2011-07-04 17:25 ` ro at CeBiTec dot Uni-Bielefeld.DE
2011-07-06 21:23 ` jason at gcc dot gnu.org
2011-07-06 21:24 ` jason at gcc dot gnu.org
2011-07-11 10:22 ` ro at gcc dot gnu.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=bug-49568-4-jQcabvG3fr@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).