From patchwork Tue Feb 4 15:20:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 1233382 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-518894-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=wEgoTvt2; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48BpL162HlzB3xm for ; Wed, 5 Feb 2020 02:20:40 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=PzEcZ5vcnngDfkq8ini80LVo8MJuG2z0Y6yOp3/7NXRON0QgW3 RuuLG3aqBPyo28JT9W2pgEMLVezaoeNub742Ulhie+b2T4jVj4JTgbEz58DDbjx6 tMImuNs83sc0Q+gQlEMOIW+r7LAOqT4mN1hkp/4N0wEyqDdsYADG9XEBw= 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:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=dGa2rbnaagmKKJbnz7p1C0D91A4=; b=wEgoTvt2hqgacjX2iz4K iAgBFfWRKm0+AlKGc9gISeYPJ813HYwdh7cv9Wf/s+ERFr3nIDWLKujq2v+M/Yee kYDHEvd4Gy1n/3OnaoL7lJiYhLbMYU18OcQqlttNWPMAlBLLchVP5yQOn4oe4cN2 HUZvSjUDLGjUzwF39Be2pjE= Received: (qmail 76163 invoked by alias); 4 Feb 2020 15:20:32 -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 75530 invoked by uid 89); 4 Feb 2020 15:20:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Feb 2020 15:20:31 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E6113AAFD; Tue, 4 Feb 2020 15:20:28 +0000 (UTC) From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] Do not load body for alias symbols. To: gcc-patches@gcc.gnu.org Cc: Jan Hubicka Message-ID: Date: Tue, 4 Feb 2020 16:20:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 X-IsSubscribed: yes Hi. The patch is about not loading of LTO bodies for symbols that are only aliases. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin gcc/lto/ChangeLog: 2020-02-04 Martin Liska PR lto/93489 * lto-dump.c (dump_list_functions): Do not load body for aliases. (dump_body): Likewise here. --- gcc/lto/lto-dump.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/gcc/lto/lto-dump.c b/gcc/lto/lto-dump.c index 2983c22fdd5..96e26d9e81c 100644 --- a/gcc/lto/lto-dump.c +++ b/gcc/lto/lto-dump.c @@ -122,7 +122,7 @@ public: cgraph_node *cnode = dyn_cast (node); gcc_assert (cnode); - return (cnode->definition) + return (cnode->definition && !cnode->alias) ? n_basic_blocks_for_fn (DECL_STRUCT_FUNCTION (cnode->decl)) : 0; } @@ -157,10 +157,10 @@ void dump_list_functions (void) cgraph_node *cnode; FOR_EACH_FUNCTION (cnode) { - if (cnode->definition) + if (cnode->definition && !cnode->alias) cnode->get_untransformed_body (); symbol_entry *e = new function_entry (cnode); - if (!flag_lto_dump_defined || cnode->definition) + if (!flag_lto_dump_defined || (cnode->definition && !cnode->alias)) v.safe_push (e); } @@ -260,13 +260,15 @@ void dump_body () } cgraph_node *cnode; FOR_EACH_FUNCTION (cnode) - if (cnode->definition && !strcmp (cnode->name (), flag_dump_body)) - { - printf ("Gimple Body of Function: %s\n", cnode->name ()); - cnode->get_untransformed_body (); - debug_function (cnode->decl, flags); - flag = 1; - } + if (cnode->definition + && !cnode->alias + && !strcmp (cnode->name (), flag_dump_body)) + { + printf ("Gimple Body of Function: %s\n", cnode->name ()); + cnode->get_untransformed_body (); + debug_function (cnode->decl, flags); + flag = 1; + } if (!flag) error_at (input_location, "Function not found."); return;