public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Biener <rguenth@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r10-10061] ipa/97565 - fix IPA PTA body availability check
Date: Tue, 24 Aug 2021 09:17:17 +0000 (GMT)	[thread overview]
Message-ID: <20210824091717.D7BD53858430@sourceware.org> (raw)

https://gcc.gnu.org/g:3b0c38012093078549811ae1ca0215d1047a2be2

commit r10-10061-g3b0c38012093078549811ae1ca0215d1047a2be2
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Aug 23 15:37:48 2021 +0200

    ipa/97565 - fix IPA PTA body availability check
    
    Looks like the existing check using has_gimple_body_p isn't enough
    at LTRANS time but I need to check in_other_partition as well.
    
    2021-08-23  Richard Biener  <rguenther@suse.de>
    
            PR ipa/97565
            * tree-ssa-structalias.c (ipa_pta_execute): Check in_other_partition
            in addition to has_gimple_body.
    
            * g++.dg/lto/pr97565_0.C: New testcase.
            * g++.dg/lto/pr97565_1.C: Likewise.
    
    (cherry picked from commit 0230e69a3fabe6ad1d80cdf308ad1bf1934c4381)

Diff:
---
 gcc/testsuite/g++.dg/lto/pr97565_0.C |  7 +++++++
 gcc/testsuite/g++.dg/lto/pr97565_1.C |  6 ++++++
 gcc/tree-ssa-structalias.c           | 22 ++++++++++++++--------
 3 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/gcc/testsuite/g++.dg/lto/pr97565_0.C b/gcc/testsuite/g++.dg/lto/pr97565_0.C
new file mode 100644
index 00000000000..f4572e17bf5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/pr97565_0.C
@@ -0,0 +1,7 @@
+// { dg-lto-do link }
+// { dg-lto-options { "-O -flto -fipa-pta" } }
+
+extern "C" void abort(void)
+{
+  abort();
+}
diff --git a/gcc/testsuite/g++.dg/lto/pr97565_1.C b/gcc/testsuite/g++.dg/lto/pr97565_1.C
new file mode 100644
index 00000000000..ff7b638e9c5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/pr97565_1.C
@@ -0,0 +1,6 @@
+extern "C" void abort(void);
+
+int main(int argc, char * argv[])
+{
+  abort();
+}
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 40171d53d0a..5bf4738b526 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -8134,10 +8134,12 @@ ipa_pta_execute (void)
   FOR_EACH_DEFINED_FUNCTION (node)
     {
       varinfo_t vi;
-      /* Nodes without a body are not interesting.  Especially do not
-         visit clones at this point for now - we get duplicate decls
-	 there for inline clones at least.  */
-      if (!node->has_gimple_body_p () || node->inlined_to)
+      /* Nodes without a body in this partition are not interesting.
+	 Especially do not visit clones at this point for now - we
+	 get duplicate decls there for inline clones at least.  */
+      if (!node->has_gimple_body_p ()
+	  || node->in_other_partition
+	  || node->inlined_to)
 	continue;
       node->get_body ();
 
@@ -8215,8 +8217,10 @@ ipa_pta_execute (void)
       struct function *func;
       basic_block bb;
 
-      /* Nodes without a body are not interesting.  */
-      if (!node->has_gimple_body_p () || node->clone_of)
+      /* Nodes without a body in this partition are not interesting.  */
+      if (!node->has_gimple_body_p ()
+	  || node->in_other_partition
+	  || node->clone_of)
 	continue;
 
       if (dump_file)
@@ -8345,8 +8349,10 @@ ipa_pta_execute (void)
       unsigned i;
       basic_block bb;
 
-      /* Nodes without a body are not interesting.  */
-      if (!node->has_gimple_body_p () || node->clone_of)
+      /* Nodes without a body in this partition are not interesting.  */
+      if (!node->has_gimple_body_p ()
+	  || node->in_other_partition
+	  || node->clone_of)
 	continue;
 
       fn = DECL_STRUCT_FUNCTION (node->decl);


                 reply	other threads:[~2021-08-24  9:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210824091717.D7BD53858430@sourceware.org \
    --to=rguenth@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).