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 middle-end/57366] gcc.dg/lto/attr-weakref-1 FAILs
Date: Sat, 01 Jun 2013 14:57:00 -0000	[thread overview]
Message-ID: <bug-57366-4-XIUS4tqL6i@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-57366-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #14 from Jan Hubicka <hubicka at ucw dot cz> ---
Hi,
the problems with weakref are bit deeper than I though.  They way RTL rewriting
is done
breaks completely with any symbol renaming that is quite common with LTO.  I am
testing
the following

Index: cgraphunit.c
===================================================================
--- cgraphunit.c    (revision 199577)
+++ cgraphunit.c    (working copy)
@@ -1996,6 +1996,32 @@ compile (void)
   bitmap_obstack_release (NULL);
   mark_functions_to_output ();

+  /* When weakref support is missing, we autmatically translate all
+     references to NODE to references to its ultimate alias target.
+     The renaming mechanizm uses flag IDENTIFIER_TRANSPARENT_ALIAS and
+     TREE_CHAIN.
+
+     Set up this mapping before we output any assembler but once we are sure
+     that all symbol renaming is done.
+
+     FIXME: All this uglyness can go away if we just do renaming at gimple
+     level by physically rewritting the IL.  At the moment we can only
redirect
+     calls, so we need infrastructure for renaming references as well.  */
+#ifndef ASM_OUTPUT_WEAKREF
+  symtab_node node;
+
+  FOR_EACH_SYMBOL (node)
+    if (node->symbol.alias
+    && lookup_attribute ("weakref", DECL_ATTRIBUTES (node->symbol.decl)))
+      {
+    IDENTIFIER_TRANSPARENT_ALIAS
+       (DECL_ASSEMBLER_NAME (node->symbol.decl)) = 1;
+    TREE_CHAIN (DECL_ASSEMBLER_NAME (node->symbol.decl))
+       = (node->symbol.alias_target ? node->symbol.alias_target
+          : DECL_ASSEMBLER_NAME (symtab_alias_target (node)->symbol.decl));
+      }
+#endif
+
   cgraph_state = CGRAPH_STATE_EXPANSION;
   if (!flag_toplevel_reorder)
     output_in_order ();


  parent reply	other threads:[~2013-06-01 14:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 10:07 [Bug middle-end/57366] New: " ro at gcc dot gnu.org
2013-05-22 10:08 ` [Bug middle-end/57366] " ro at gcc dot gnu.org
2013-05-22 11:25 ` hubicka at gcc dot gnu.org
2013-05-22 12:30 ` ro at gcc dot gnu.org
2013-05-22 12:31 ` ro at gcc dot gnu.org
2013-05-22 13:59 ` hubicka at gcc dot gnu.org
2013-05-22 14:44 ` ro at CeBiTec dot Uni-Bielefeld.DE
2013-05-22 14:46 ` ro at gcc dot gnu.org
2013-05-23 10:01 ` ro at CeBiTec dot Uni-Bielefeld.DE
2013-05-23 11:37 ` hubicka at gcc dot gnu.org
2013-05-23 13:41 ` hubicka at ucw dot cz
2013-05-23 18:30 ` ro at CeBiTec dot Uni-Bielefeld.DE
2013-05-25 10:26 ` dominiq at lps dot ens.fr
2013-05-27 15:22 ` ro at CeBiTec dot Uni-Bielefeld.DE
2013-05-29 13:05 ` hubicka at gcc dot gnu.org
2013-06-01 14:57 ` hubicka at ucw dot cz [this message]
2013-06-03  9:11 ` ro at CeBiTec dot Uni-Bielefeld.DE
2013-09-04 17:00 ` hubicka at gcc dot gnu.org
2015-06-23  8:47 ` rguenth 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-57366-4-XIUS4tqL6i@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).