From patchwork Fri May 10 18:27:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carrot Wei X-Patchwork-Id: 243053 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 5F0102C00CF for ; Sat, 11 May 2013 04:27:30 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=GWMgBv9kCT3Ll7lQpN9STKNcMVrr/phZK3Sgd0FbkF7b/i h3n009Pf03tz0xMq6IWkLqyE2xjM88qmAf/9HXUTfyw2h5uJ3Ww7m9/lqKg52TMK zUCdR8UBVVKb/7d74iUYfDZx0IbueeHadVeHwN/hAmYYu+H2h7WzTYfUhw5As= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=5Xv3x41j7ebT3R59fgxyUyeDYpI=; b=e6yDz/wos+XeOjVLz8vq Cxbr6bZ5nI2v4S+WN6RAeWc+T/MCdTzU6VLg2HJL6GCdZYKM+bPpzHivYNBRWno9 xOtvm9USFYVAwLsqp60hLPpTzVWP53bsOHEvlWl4NuN+PGuq17g3Eu3c37mlxpv1 ajz3pdOe98e3Q8UJOqivFKM= Received: (qmail 9824 invoked by alias); 10 May 2013 18:27:24 -0000 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 Received: (qmail 9813 invoked by uid 89); 10 May 2013 18:27:23 -0000 X-Spam-SWARE-Status: No, score=-3.7 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-qc0-f170.google.com (HELO mail-qc0-f170.google.com) (209.85.216.170) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 10 May 2013 18:27:23 +0000 Received: by mail-qc0-f170.google.com with SMTP id s11so2453406qcw.1 for ; Fri, 10 May 2013 11:27:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=Md+bgifvXtsIpokbYtrCkVQnTcYaemYl41JMnanOEz4=; b=hawYqaRVgG6dl+stfJhFR4nure6fhHYXRh5Y4jsghzV/qTBe42+pGhgIFqBqjTN6Wy CqYaNKv4+nI3/tJUTd9KDWufXZ6KJJnLt9Vbw3oGYldvzIEn9+DXVslyi2b5/yne8Zry bHnQRRrbNSFlQM0uVfr/2kVYNMX4Q8wNX1HEV36JmdQLKMlnbuQilQ9eA/yHefvOO0DP s/X+xoAmWxi7tiER4WrZmX474nJ4GfCD6CEAOU6IbqXSqGP1fENtRcT08m8ZltDh/urG slZhAW7DF2ymHt+8llHAKc0ceVdfxpAToon0Q24ve06rUObQHge9PaowN0ah0MRtyFvl Zhow== MIME-Version: 1.0 X-Received: by 10.49.12.135 with SMTP id y7mr14506550qeb.18.1368210441336; Fri, 10 May 2013 11:27:21 -0700 (PDT) Received: by 10.229.178.195 with HTTP; Fri, 10 May 2013 11:27:21 -0700 (PDT) Date: Fri, 10 May 2013 11:27:21 -0700 Message-ID: Subject: [RFC] Make the new var decl STATIC in function dw2_output_indirect_constant_1 From: Carrot Wei To: "gcc-patches@gcc.gnu.org" X-Gm-Message-State: ALoCoQlwqokVjsEnuPHtNs7l7nxCcxOaytA4SGAS30xM6Si2mrOooUbx9AKkXsMtyNFuGYxhECb+4ly3G3/h9Iq4fK1FK3AhQkH8y+bi+BmjFomgVA5EQ4ljTa99uRaAsO6UuOmnTJBmmXUaZL+/P0mjfemPig11vixFGWgGOQbZli9TTNfCLuc4cz4qhmnKEghf2jYNfgbL Hi In function dw2_output_indirect_constant_1 a new var decl is created. Only When the variable is not PUBLIC it is allocated static storage. Does anybody know why the variable is not allocated static storage by marking TREE_STATIC when it is PUBLIC? The following patch marks the STATIC flag in all cases. It can pass bootstrap and regression test on x86-64. Any comments? thanks Carrot 2013-05-09 Guozhi Wei * dwarf2asm.c (dw2_output_indirect_constant_1): Mark new decl STATIC. Index: dwarf2asm.c =================================================================== --- dwarf2asm.c (revision 198794) +++ dwarf2asm.c (working copy) @@ -906,6 +906,7 @@ DECL_IGNORED_P (decl) = 1; DECL_INITIAL (decl) = decl; TREE_READONLY (decl) = 1; + TREE_STATIC (decl) = 1; if (TREE_PUBLIC (id)) { @@ -914,8 +915,6 @@ if (USE_LINKONCE_INDIRECT) DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN; } - else - TREE_STATIC (decl) = 1; sym_ref = gen_rtx_SYMBOL_REF (Pmode, sym); assemble_variable (decl, 1, 1, 1);