From patchwork Thu Dec 13 15:17:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 206116 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id C95B62C008F for ; Fri, 14 Dec 2012 02:19:01 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1356016742; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Cc:Subject:Message-ID:User-Agent:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=QiOxxMT 9szUvzY05Qi40zBAuUuc=; b=Xhn0qTnG4nhsqvE6JBJYkrjReqA7+ikhfBbTuGf 19c0ni7RREyYhYoh0RnCE9bYkAnBXZvSlAgbjv23f39uBfV5h+i5ewHp63oPTXAM KY3mNw0oOksrvC9iki0yR0G1Oy4MUH8lNIxFSysRt/LOh9nGXGlXzgeD/K/tYNeO L1BY= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Cc:Subject:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=vV7eGRYGkKX/PUQq2TBQf42RSpPdaf6TGUFd8zNRf/+sQtVMmAv/+Rqkeuz6Ic WEKljgPqiCIFxXyKumxcs7jgejhb2oyau0pL4jiepFvsT7fMpz0TvoOk1JW1Mwhn nBwviEkxdkoPy95dKw9LhhXU/jywxrt/4INVEER9BTJt8=; Received: (qmail 18118 invoked by alias); 13 Dec 2012 15:18:51 -0000 Received: (qmail 18101 invoked by uid 22791); 13 Dec 2012 15:18:50 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 13 Dec 2012 15:18:47 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id E36B8A52C6 for ; Thu, 13 Dec 2012 16:18:45 +0100 (CET) Date: Thu, 13 Dec 2012 16:17:43 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org Cc: Jan Hubicka Subject: [PATCH] Fix PR53476 Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This fixes the weak alias regression FAIL: gcc.dg/attr-weakref-1.c. I tracked it down to the fact that this has both DECL_EXTERNAL and TREE_STATIC (and RTL) set but the trunk code differs from the 4.7 code in that it has an additional !DECL_EXTERNAL check (for no apparent reason, that is, no testcase or comment). Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2012-12-13 Richard Biener PR middle-end/53476 * varpool.c (varpool_remove_unreferenced_decls): Revert to 4.7 behavior. Index: gcc/varpool.c =================================================================== --- gcc/varpool.c (revision 194473) +++ gcc/varpool.c (working copy) @@ -358,8 +358,7 @@ varpool_remove_unreferenced_decls (void) && (!varpool_can_remove_if_no_refs (node) /* We just expanded all function bodies. See if any of them needed the variable. */ - || (!DECL_EXTERNAL (node->symbol.decl) - && DECL_RTL_SET_P (node->symbol.decl)))) + || DECL_RTL_SET_P (node->symbol.decl))) { enqueue_node (node, &first); if (cgraph_dump_file)