From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22201 invoked by alias); 9 Jun 2013 03:30:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 22136 invoked by uid 89); 9 Jun 2013 03:29:53 -0000 X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.1 Received: from mail-ee0-f48.google.com (HELO mail-ee0-f48.google.com) (74.125.83.48) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sun, 09 Jun 2013 03:29:52 +0000 Received: by mail-ee0-f48.google.com with SMTP id b47so1588187eek.21 for ; Sat, 08 Jun 2013 20:29:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=VLBx6akf27tSe7c+dJy+B+vGPcT3ou98GGe8KYOiSII=; b=YKj/Cm6dxu29ybJ2sRgTQ2lUW/dUi9Qw0jEFm9A6KZK250mx4lGRnqwqbOEcdOmdBW wjdv5Y9fr+mS8gpoUHJBds5cJC/1rO5MzVkPu/WWOX2l8kPjWg5er9blG2Hk7JcrvR7A mp8hU/GDsox38t6L9VhYQXdMan0+EoIgf5HHeEB5RzRP0RNSKB5Gcpv/srgFK3xSw6w9 ZDeEYTQnB1Ap81MMStAAlyZ24dVMYfn6+sY7f5/++IAbDfcdvW5OttNtcfF3NhdfFZ4H qqpUda5g2ARn5sWAk06lGndNw9RdZQxnoATeW5WnrxBgpRaSC4GKd2/uGlzNZ8y+2bnD cZiQ== MIME-Version: 1.0 X-Received: by 10.14.209.5 with SMTP id r5mr5044643eeo.112.1370748590269; Sat, 08 Jun 2013 20:29:50 -0700 (PDT) Received: by 10.14.210.69 with HTTP; Sat, 8 Jun 2013 20:29:50 -0700 (PDT) Date: Sun, 09 Jun 2013 03:30:00 -0000 Message-ID: Subject: [GOOGLE] Avoid emitting duplicated weakref From: Dehao Chen To: GCC Patches Cc: David Li Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmR8gQghRQ2wjaP+j3OAd7dBPNFvv9Nk7snZh9AJvBvlovwL+5l9DnHque2nloK3y6BZXavhEf2FSCqnHXwSeJsQOMebkZRd+CG8Y/aDcp4iERWy52ZUeyix1gq+Z170P6uw5Oo3Q32B9EY6WR2YwNRCEQl9qzsjJOecnTlqCG5BFXk1EeoP7iIXI4wzH0yqorzo9guD43t7G0lP2K+8d86tFKf0g== X-SW-Source: 2013-06/txt/msg00465.txt.bz2 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);