From patchwork Tue Apr 18 14:44:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 84894 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2906487vqo; Tue, 18 Apr 2023 07:44:50 -0700 (PDT) X-Google-Smtp-Source: AKy350albMQ7MKFFDja9PUNngaIoweILLDpfYXb7PlQs5o/kWi0yxs3Y+gzNOPsYwEiTNHjE/psb X-Received: by 2002:a17:907:1701:b0:933:3a22:8513 with SMTP id le1-20020a170907170100b009333a228513mr12582139ejc.53.1681829089900; Tue, 18 Apr 2023 07:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681829089; cv=none; d=google.com; s=arc-20160816; b=zw9ImxG/tOXTlq2PvAZ00m8Jp1ftIkZ/YvbM5RcY7oeX1PJjiwBhPPhhP9Qf3jQkov 0nBYx/t0cszmhxesxlJqaZ9wExXiLQxg/O8fPp0gbDQAIPYAMQ/VxeYmiQA02JphMTs/ xJrUWKj4ctsuvBldeXKcy5JC8KVGqlRR9IC2UqphD4FR7TYDxFNQZqPk6duNiOMiPIqm aEi7VVB5BTRjE0ms9X6hWVedCRAg/Keb+WESad4auAQuwQ8xHambworEvKFBFUN3VNJK THYw+KHByCKdgPyceTELlYnr4p18tMM4nbBY9NNC7zoKMHstoQYmupvx+n7YoyogdkeW 180w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:message-id :mime-version:subject:to:date:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=0ADCxxzGy8nkzmQjcPhOXQB7AppF3j894DbqWJI9X3c=; b=HTAHdFbDgVFv0EddOya4th30RpgAmLRX9j9GJG2Brrax7Y6LC3yGq+iOnKbKKi1xJL ec33dET3mkMKUiO5DNkVbIroKqqGs9kYrd8TRfDE+X6/ENhE07bbmC1sDQnIdYTm4xBp kEEgh9DhQ9+P/xXm56lRsiYxebwZc98hLot5HdNI6nZza/ZCTrJNarXCJ/1Rxh4SWZYe QHy1CPEB6GVyUXnKYVVlIbk/ob4D7pBlLSRdEyUt8dn8UUrLfTVp24zS5T25ko61Z/At GPY0F48AT/KPuYrfiEej2QQhKfUTz02R+YRuPcspZU9jqHUjJq8A4CSZCFcClllYZn04 Njtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="I6/PB5oa"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id fe10-20020a1709072a4a00b0094f7092794dsi4527321ejc.331.2023.04.18.07.44.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Apr 2023 07:44:49 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="I6/PB5oa"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5735A385843E for ; Tue, 18 Apr 2023 14:44:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5735A385843E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681829088; bh=0ADCxxzGy8nkzmQjcPhOXQB7AppF3j894DbqWJI9X3c=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=I6/PB5oaXmoQrMu/Lc4iUK5awqjySZIxyWNCTYhOFvyrJpG9VdmfK4onxLyFaGCQN rWlyPtRHUjLlrJNHaUtA3BORgoSYNooT7xUd6B7uBO/hBFwQr1cKVn5Ea8nenzK2KE DOv0hYf8V1ek3v+qIEjMr6QigdXCgTKD9DTgl0VE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 6E25C3858D1E for ; Tue, 18 Apr 2023 14:44:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6E25C3858D1E Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 831141F8D9 for ; Tue, 18 Apr 2023 14:44:01 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 70F8D139CC for ; Tue, 18 Apr 2023 14:44:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 3WJfGrGsPmS+ZQAAMHmgww (envelope-from ) for ; Tue, 18 Apr 2023 14:44:01 +0000 Date: Tue, 18 Apr 2023 16:44:01 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] Shrink points-to analysis dumps when not dumping with -details MIME-Version: 1.0 Message-Id: <20230418144401.70F8D139CC@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763525619992118500?= X-GMAIL-MSGID: =?utf-8?q?1763525619992118500?= The following allows to get PTA stats with -stats without blowing up your filesystem by guarding constraint and solution dumping with TDF_DETAILS and the SSA points-to info with TDF_DETAILS or TDF_ALIAS. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed to trunk. * tree-ssa-structalias.cc (dump_sa_stats): Split out from... (dump_sa_points_to_info): ... this function. (compute_points_to_sets): Guard large dumps with TDF_DETAILS, and call dump_sa_stats guarded with TDF_STATS. (ipa_pta_execute): Likewise. (compute_may_aliases): Guard dump_alias_info with TDF_DETAILS|TDF_ALIAS. gcc.dg/ipa/ipa-pta-16.c: Use -details for dump. gcc.dg/tm/alias-1.c: Likewise. gcc.dg/tm/alias-2.c: Likewise. gcc.dg/torture/ipa-pta-1.c: Likewise. gcc.dg/torture/pr39074-2.c: Likewise. gcc.dg/torture/pr39074.c: Likewise. gcc.dg/torture/pta-callused-1.c: Likewise. gcc.dg/torture/pta-escape-1.c: Likewise. gcc.dg/torture/pta-ptrarith-1.c: Likewise. gcc.dg/torture/pta-ptrarith-2.c: Likewise. gcc.dg/torture/pta-ptrarith-3.c: Likewise. gcc.dg/torture/pta-structcopy-1.c: Likewise. gcc.dg/torture/ssa-pta-fn-1.c: Likewise. gcc.dg/tree-ssa/alias-19.c: Likewise. gcc.dg/tree-ssa/pta-callused.c: Likewise. gcc.dg/tree-ssa/pta-fp.c: Likewise. gcc.dg/tree-ssa/pta-ptrarith-1.c: Likewise. gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise. --- gcc/testsuite/gcc.dg/ipa/ipa-pta-16.c | 2 +- gcc/testsuite/gcc.dg/tm/alias-1.c | 2 +- gcc/testsuite/gcc.dg/tm/alias-2.c | 2 +- gcc/testsuite/gcc.dg/torture/ipa-pta-1.c | 2 +- gcc/testsuite/gcc.dg/torture/pr39074-2.c | 2 +- gcc/testsuite/gcc.dg/torture/pr39074.c | 2 +- gcc/testsuite/gcc.dg/torture/pta-callused-1.c | 2 +- gcc/testsuite/gcc.dg/torture/pta-escape-1.c | 2 +- gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c | 2 +- gcc/testsuite/gcc.dg/torture/pta-ptrarith-2.c | 2 +- gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c | 2 +- .../gcc.dg/torture/pta-structcopy-1.c | 2 +- gcc/testsuite/gcc.dg/torture/ssa-pta-fn-1.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/alias-19.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/pta-fp.c | 2 +- .../gcc.dg/tree-ssa/pta-ptrarith-1.c | 2 +- .../gcc.dg/tree-ssa/pta-ptrarith-2.c | 2 +- gcc/tree-ssa-structalias.cc | 63 ++++++++++--------- 19 files changed, 53 insertions(+), 46 deletions(-) diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-pta-16.c b/gcc/testsuite/gcc.dg/ipa/ipa-pta-16.c index 83b9cd8e1e3..68fa1c94018 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-pta-16.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-pta-16.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-O2 -fno-tree-sra -fipa-pta -fdump-ipa-pta2" } */ +/* { dg-options "-O2 -fno-tree-sra -fipa-pta -fdump-ipa-pta2-details" } */ struct X { diff --git a/gcc/testsuite/gcc.dg/tm/alias-1.c b/gcc/testsuite/gcc.dg/tm/alias-1.c index 86b3d7ab0ef..b90d142072d 100644 --- a/gcc/testsuite/gcc.dg/tm/alias-1.c +++ b/gcc/testsuite/gcc.dg/tm/alias-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fgnu-tm -fdump-tree-ealias -O" } */ +/* { dg-options "-fgnu-tm -fdump-tree-ealias-details -O" } */ typedef __UINTPTR_TYPE__ ptrcast; diff --git a/gcc/testsuite/gcc.dg/tm/alias-2.c b/gcc/testsuite/gcc.dg/tm/alias-2.c index dd3db94cbf7..19677412ee2 100644 --- a/gcc/testsuite/gcc.dg/tm/alias-2.c +++ b/gcc/testsuite/gcc.dg/tm/alias-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fgnu-tm -fdump-tree-ealias -O" } */ +/* { dg-options "-fgnu-tm -fdump-tree-ealias-details -O" } */ typedef __UINTPTR_TYPE__ ptrcast; diff --git a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c index 30156a3b06d..fdac819ed7a 100644 --- a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c +++ b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { nonpic || pie_enabled } } } */ -/* { dg-options "-fipa-pta -fdump-ipa-pta2 -fno-ipa-icf" } */ +/* { dg-options "-fipa-pta -fdump-ipa-pta2-details -fno-ipa-icf" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */ struct X { char x; char y; }; diff --git a/gcc/testsuite/gcc.dg/torture/pr39074-2.c b/gcc/testsuite/gcc.dg/torture/pr39074-2.c index 7286a4f5b30..16c10e88277 100644 --- a/gcc/testsuite/gcc.dg/torture/pr39074-2.c +++ b/gcc/testsuite/gcc.dg/torture/pr39074-2.c @@ -1,6 +1,6 @@ /* { dg-do run } */ /* { dg-require-effective-target stdint_types } */ -/* { dg-options "-fdump-tree-alias" } */ +/* { dg-options "-fdump-tree-alias-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */ #include diff --git a/gcc/testsuite/gcc.dg/torture/pr39074.c b/gcc/testsuite/gcc.dg/torture/pr39074.c index 40ecdb9c6fb..eec4873405d 100644 --- a/gcc/testsuite/gcc.dg/torture/pr39074.c +++ b/gcc/testsuite/gcc.dg/torture/pr39074.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-fdump-tree-alias" } */ +/* { dg-options "-fdump-tree-alias-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */ typedef __INTPTR_TYPE__ intptr_t; diff --git a/gcc/testsuite/gcc.dg/torture/pta-callused-1.c b/gcc/testsuite/gcc.dg/torture/pta-callused-1.c index 0ca6ac91119..36cf02feeae 100644 --- a/gcc/testsuite/gcc.dg/torture/pta-callused-1.c +++ b/gcc/testsuite/gcc.dg/torture/pta-callused-1.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-fdump-tree-alias" } */ +/* { dg-options "-fdump-tree-alias-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */ volatile int i; diff --git a/gcc/testsuite/gcc.dg/torture/pta-escape-1.c b/gcc/testsuite/gcc.dg/torture/pta-escape-1.c index 9172bedb880..d7e9078eba7 100644 --- a/gcc/testsuite/gcc.dg/torture/pta-escape-1.c +++ b/gcc/testsuite/gcc.dg/torture/pta-escape-1.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-fdump-tree-alias" } */ +/* { dg-options "-fdump-tree-alias-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */ int *p; diff --git a/gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c b/gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c index 85b68068b12..a1dcf4f2ebd 100644 --- a/gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c +++ b/gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-fdump-tree-alias" } */ +/* { dg-options "-fdump-tree-alias-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */ struct Foo { diff --git a/gcc/testsuite/gcc.dg/torture/pta-ptrarith-2.c b/gcc/testsuite/gcc.dg/torture/pta-ptrarith-2.c index 4f5556acc93..7cda636a5a0 100644 --- a/gcc/testsuite/gcc.dg/torture/pta-ptrarith-2.c +++ b/gcc/testsuite/gcc.dg/torture/pta-ptrarith-2.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-fdump-tree-alias" } */ +/* { dg-options "-fdump-tree-alias-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */ struct Foo { diff --git a/gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c b/gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c index 70829375c0c..7a2b8db9aa2 100644 --- a/gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c +++ b/gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-fdump-tree-alias" } */ +/* { dg-options "-fdump-tree-alias-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c b/gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c index f9cf8920b63..9c4d6801b96 100644 --- a/gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c +++ b/gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-fdump-tree-ealias -Wno-attributes" } */ +/* { dg-options "-fdump-tree-ealias-details -Wno-attributes" } */ /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ struct X diff --git a/gcc/testsuite/gcc.dg/torture/ssa-pta-fn-1.c b/gcc/testsuite/gcc.dg/torture/ssa-pta-fn-1.c index de019a7ecaf..3746320722f 100644 --- a/gcc/testsuite/gcc.dg/torture/ssa-pta-fn-1.c +++ b/gcc/testsuite/gcc.dg/torture/ssa-pta-fn-1.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-fdump-tree-alias" } */ +/* { dg-options "-fdump-tree-alias-details" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/tree-ssa/alias-19.c b/gcc/testsuite/gcc.dg/tree-ssa/alias-19.c index 330ec001705..219db9b2297 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/alias-19.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/alias-19.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-O2 -fdump-tree-alias" } */ +/* { dg-options "-O2 -fdump-tree-alias-details" } */ const static int a; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c b/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c index b9a57d8d135..c7e96fb2cc3 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 --param max-fields-for-field-sensitive=2 -fdump-tree-alias" } */ +/* { dg-options "-O2 --param max-fields-for-field-sensitive=2 -fdump-tree-alias-details" } */ struct Foo { int *p, *q; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pta-fp.c b/gcc/testsuite/gcc.dg/tree-ssa/pta-fp.c index 1ff007e505d..59652c3488a 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pta-fp.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pta-fp.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-alias" } */ +/* { dg-options "-O2 -fdump-tree-alias-details" } */ extern double cos (double); extern double sin (double); double f(double a) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c index b56d589d7b7..9e4c0feb38e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fno-tree-forwprop -fno-tree-ccp -fdump-tree-ealias" } */ +/* { dg-options "-O2 -fno-tree-forwprop -fno-tree-ccp -fdump-tree-ealias-details" } */ extern void abort (void); struct X { diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c index be06a75ed8d..70b432f0f39 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fno-tree-forwprop -fno-tree-ccp -fdump-tree-ealias" } */ +/* { dg-options "-O2 -fno-tree-forwprop -fno-tree-ccp -fdump-tree-ealias-details" } */ extern void abort (void); struct X { diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc index c3c5bce42df..fa3a2e4e1f9 100644 --- a/gcc/tree-ssa-structalias.cc +++ b/gcc/tree-ssa-structalias.cc @@ -7137,33 +7137,33 @@ pt_solutions_intersect (struct pt_solution *pt1, struct pt_solution *pt2) return res; } +/* Dump stats information to OUTFILE. */ + +static void +dump_sa_stats (FILE *outfile) +{ + fprintf (outfile, "Points-to Stats:\n"); + fprintf (outfile, "Total vars: %d\n", stats.total_vars); + fprintf (outfile, "Non-pointer vars: %d\n", + stats.nonpointer_vars); + fprintf (outfile, "Statically unified vars: %d\n", + stats.unified_vars_static); + fprintf (outfile, "Dynamically unified vars: %d\n", + stats.unified_vars_dynamic); + fprintf (outfile, "Iterations: %d\n", stats.iterations); + fprintf (outfile, "Number of edges: %d\n", stats.num_edges); + fprintf (outfile, "Number of implicit edges: %d\n", + stats.num_implicit_edges); +} /* Dump points-to information to OUTFILE. */ static void dump_sa_points_to_info (FILE *outfile) { - unsigned int i; - fprintf (outfile, "\nPoints-to sets\n\n"); - if (dump_flags & TDF_STATS) - { - fprintf (outfile, "Stats:\n"); - fprintf (outfile, "Total vars: %d\n", stats.total_vars); - fprintf (outfile, "Non-pointer vars: %d\n", - stats.nonpointer_vars); - fprintf (outfile, "Statically unified vars: %d\n", - stats.unified_vars_static); - fprintf (outfile, "Dynamically unified vars: %d\n", - stats.unified_vars_dynamic); - fprintf (outfile, "Iterations: %d\n", stats.iterations); - fprintf (outfile, "Number of edges: %d\n", stats.num_edges); - fprintf (outfile, "Number of implicit edges: %d\n", - stats.num_implicit_edges); - } - - for (i = 1; i < varmap.length (); i++) + for (unsigned i = 1; i < varmap.length (); i++) { varinfo_t vi = get_varinfo (i); if (!vi->may_have_pointers) @@ -7544,7 +7544,7 @@ compute_points_to_sets (void) } } - if (dump_file) + if (dump_file && (dump_flags & TDF_DETAILS)) { fprintf (dump_file, "Points-to analysis\n\nConstraints:\n\n"); dump_constraints (dump_file, 0); @@ -7617,7 +7617,10 @@ compute_points_to_sets (void) BITMAP_FREE (new_delta); } - if (dump_file) + if (dump_file && (dump_flags & TDF_STATS)) + dump_sa_stats (dump_file); + + if (dump_file && (dump_flags & TDF_DETAILS)) dump_sa_points_to_info (dump_file); /* Compute the points-to set for ESCAPED used for call-clobber analysis. */ @@ -8039,7 +8042,8 @@ compute_may_aliases (void) "because IPA points-to information is available.\n\n"); /* But still dump what we have remaining it. */ - dump_alias_info (dump_file); + if (dump_flags & (TDF_DETAILS|TDF_ALIAS)) + dump_alias_info (dump_file); } return 0; @@ -8051,7 +8055,7 @@ compute_may_aliases (void) compute_points_to_sets (); /* Debugging dumps. */ - if (dump_file) + if (dump_file && (dump_flags & (TDF_DETAILS|TDF_ALIAS))) dump_alias_info (dump_file); /* Compute restrict-based memory disambiguations. */ @@ -8312,7 +8316,7 @@ ipa_pta_execute (void) fprintf (dump_file, "\n"); } - if (dump_file) + if (dump_file && (dump_flags & TDF_DETAILS)) { fprintf (dump_file, "Generating generic constraints\n\n"); dump_constraints (dump_file, from); @@ -8351,7 +8355,7 @@ ipa_pta_execute (void) vi = create_function_info_for (node->decl, alias_get_name (node->decl), false, nonlocal_p); - if (dump_file + if (dump_file && (dump_flags & TDF_DETAILS) && from != constraints.length ()) { fprintf (dump_file, @@ -8392,7 +8396,7 @@ ipa_pta_execute (void) vi->is_ipa_escape_point = true; } - if (dump_file + if (dump_file && (dump_flags & TDF_DETAILS) && from != constraints.length ()) { fprintf (dump_file, @@ -8449,7 +8453,7 @@ ipa_pta_execute (void) } } - if (dump_file) + if (dump_file && (dump_flags & TDF_DETAILS)) { fprintf (dump_file, "\n"); dump_constraints (dump_file, from); @@ -8461,7 +8465,10 @@ ipa_pta_execute (void) /* From the constraints compute the points-to sets. */ solve_constraints (); - if (dump_file) + if (dump_file && (dump_flags & TDF_STATS)) + dump_sa_stats (dump_file); + + if (dump_file && (dump_flags & TDF_DETAILS)) dump_sa_points_to_info (dump_file); /* Now post-process solutions to handle locals from different