From patchwork Fri Jan 6 14:09:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 90172 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp9463282qgi; Fri, 6 Jan 2017 06:09:56 -0800 (PST) X-Received: by 10.98.85.198 with SMTP id j189mr71045979pfb.182.1483711796113; Fri, 06 Jan 2017 06:09:56 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id v21si79573689pgh.212.2017.01.06.06.09.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jan 2017 06:09:56 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-445540-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-445540-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-445540-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=nKpZvnKZfg3M/SU695X04FebBUPfB3k76+028LrC+qc+ko+n2c fI4MHJ2uv5w8pj25+K7aWHP2S/cJxfdza7VUVDFymqZUWs4Tez1mbRfEpNftcjdI IiCIH0w+SobVBwRzBtf71Elqo6ijAiAEfAYKvD61v7vfXU4Ry+mQBCESs= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=fwPeOmuE8D23R4DObLFIVPPkgKc=; b=ywm5KsmTeTB4zSMApJBw entx+dBmLq4T916YmvGLsiskmQeYQjBhfKJOHpGm8EdUWaq+dOhpw+bYPsOWejyT 53KLvxlNOvHSr7luQ8WSgJoyN+tHPIpPM7uLncFVHZpCmb0Azgju5//zeTsJfGZc sbz+Q/hitHkDPhwBex1Js5A= Received: (qmail 130940 invoked by alias); 6 Jan 2017 14:09:41 -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 130926 invoked by uid 89); 6 Jan 2017 14:09:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS, UNSUBSCRIBE_BODY autolearn=no version=3.3.2 spammy=nathan@acm.org, nathanacmorg, UD:lto-partition.c, H*RU:200 X-HELO: mail-yw0-f171.google.com Received: from mail-yw0-f171.google.com (HELO mail-yw0-f171.google.com) (209.85.161.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Jan 2017 14:09:31 +0000 Received: by mail-yw0-f171.google.com with SMTP id l145so6117620ywb.1 for ; Fri, 06 Jan 2017 06:09:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version; bh=2WdalU46bt51BIN2dh6Bhxn60RBMstTJs7INFXkzQ6o=; b=jalknZKYpp/yRH8S4X2dcwrnZxQTUlHEKvY1dWaSrh5+QxIP3mIQjem1T7LBtjMO6t IHOZFkgzWc49vtegZrYaxg1z/G//32GI33t2Btwbupcf0ZMSxORAd80W90loDOmWLY/u 0LtPZ6d0YbH1oJoAtAaNckBhhyvcjAjLjzNzA7AzagV7nxZmK+3lkxhuN81CPz6gTyBo K0SAPZw8m2sDxnio6nbAaVIo+9o0bqBwStH042ieau1/4tOJqSUJCLlcvXKz5f34iiA1 ndE8GMEEswQTIrHW6HTEXYuHOASKkZXmQ6cavskTdvd8/WkQmTbRTsMZAjfQF06DDKCK l7/g== X-Gm-Message-State: AIkVDXI4Bl4oho2G0IBwIrAjq1m2+RAULIsHUCn8ZMzB1vf387XEadDo/OxqpiFd5JCAbQ== X-Received: by 10.13.235.8 with SMTP id u8mr1059138ywe.40.1483711769593; Fri, 06 Jan 2017 06:09:29 -0800 (PST) Received: from ?IPv6:2620:10d:c0a3:20fb:f6d0:5ac5:64cd:f102? ([2620:10d:c091:200::e:a6d2]) by smtp.googlemail.com with ESMTPSA id o5sm7629471ywj.4.2017.01.06.06.09.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jan 2017 06:09:28 -0800 (PST) To: GCC Patches , Jan Hubicka From: Nathan Sidwell Subject: [LTO PATCH] Improve dumping Message-ID: Date: Fri, 6 Jan 2017 09:09:27 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 This patch helped me diagnose the LTO bug I'm working on. It adds dumping of alias promotion, just after the symbol they alias. committed as obvious. nathan -- Nathan Sidwell 2017-01-06 Nathan Sidwell * lto-partition.c (promote_symbol): Write to dump file sooner, include alias promoting too. Index: lto/lto-partition.c =================================================================== --- lto/lto-partition.c (revision 244158) +++ lto/lto-partition.c (working copy) @@ -987,11 +987,15 @@ promote_symbol (symtab_node *node) TREE_PUBLIC (node->decl) = 1; DECL_VISIBILITY (node->decl) = VISIBILITY_HIDDEN; DECL_VISIBILITY_SPECIFIED (node->decl) = true; - ipa_ref *ref; + if (symtab->dump_file) + fprintf (symtab->dump_file, + "Promoting as hidden: %s (%s)\n", node->name (), + IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl))); - /* Promoting a symbol also promotes all trasparent aliases with exception + /* Promoting a symbol also promotes all transparent aliases with exception of weakref where the visibility flags are always wrong and set to !PUBLIC. */ + ipa_ref *ref; for (unsigned i = 0; node->iterate_direct_aliases (i, ref); i++) { struct symtab_node *alias = ref->referring; @@ -1000,13 +1004,13 @@ promote_symbol (symtab_node *node) TREE_PUBLIC (alias->decl) = 1; DECL_VISIBILITY (alias->decl) = VISIBILITY_HIDDEN; DECL_VISIBILITY_SPECIFIED (alias->decl) = true; + if (symtab->dump_file) + fprintf (symtab->dump_file, + "Promoting alias as hidden: %s\n", + IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl))); } gcc_assert (!alias->weakref || TREE_PUBLIC (alias->decl)); } - - if (symtab->dump_file) - fprintf (symtab->dump_file, - "Promoting as hidden: %s\n", node->name ()); } /* Return true if NODE needs named section even if it won't land in