public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Dehao Chen <dehao@google.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: David Li <davidxl@google.com>
Subject: [GOOGLE] Avoid emitting duplicated weakref
Date: Sun, 09 Jun 2013 03:30:00 -0000	[thread overview]
Message-ID: <CAO2gOZUpcpdSSaaXU4zUAV2WOzE3A18zzQe858MnQeBWEXagjA@mail.gmail.com> (raw)

This patch fixes a bug when two weakref symbols are mapped to a same
assembler name.

Testing on going.

OK for google branches if test is fine?

Thanks,
Dehao

Index: gcc/varasm.c
===================================================================
--- gcc/varasm.c (revision 199844)
+++ gcc/varasm.c (working copy)
@@ -5502,6 +5502,10 @@ do_assemble_alias (tree decl, tree target)
   if (TREE_ASM_WRITTEN (decl))
     return;

+  if (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl))
+      && TREE_ASM_WRITTEN (DECL_ASSEMBLER_NAME (decl)))
+    return;
+
   /* We must force creation of DECL_RTL for debug info generation, even though
      we don't use it here.  */
   make_decl_rtl (decl);

             reply	other threads:[~2013-06-09  3:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-09  3:30 Dehao Chen [this message]
2013-06-09  3:31 ` Xinliang David Li
2013-06-11  9:09   ` Bernhard Reutner-Fischer
2013-06-11  9:23     ` Jan Hubicka

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=CAO2gOZUpcpdSSaaXU4zUAV2WOzE3A18zzQe858MnQeBWEXagjA@mail.gmail.com \
    --to=dehao@google.com \
    --cc=davidxl@google.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).