public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Fix points-to SCC collapsing bug
Date: Mon, 27 May 2024 14:57:46 +0200 (CEST)	[thread overview]
Message-ID: <20240527125746.R9kdY970EGnCy5SrEKo8BWUT7aaDl-jMvNTj6w6aNdM@z> (raw)

When points-to analysis finds SCCs it marks the wrong node as being
part of a found cycle.  It only wants to mark the node it collapses
to but marked the entry node found rather than the one it collapses
to.  This causes fallout in the patch for PR115236 but generally
weakens the points-to solution by collapsing too many nodes.  Note
that this fix might slow down points-to solving.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

	* tree-ssa-structalias.cc (scc_visit): Mark the node we
	collapse to as being in a component.
---
 gcc/tree-ssa-structalias.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc
index 3099658f100..53552b63532 100644
--- a/gcc/tree-ssa-structalias.cc
+++ b/gcc/tree-ssa-structalias.cc
@@ -1542,8 +1542,10 @@ scc_visit (constraint_graph_t graph, class scc_info *si, unsigned int n)
 		  graph->indirect_cycles[i - FIRST_REF_NODE] = lowest_node;
 		}
 	    }
+	  bitmap_set_bit (si->deleted, lowest_node);
 	}
-      bitmap_set_bit (si->deleted, n);
+      else
+	bitmap_set_bit (si->deleted, n);
     }
   else
     si->scc_stack.safe_push (n);
-- 
2.35.3

                 reply	other threads:[~2024-05-27 12:57 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=20240527125746.R9kdY970EGnCy5SrEKo8BWUT7aaDl-jMvNTj6w6aNdM@z \
    --to=rguenther@suse.de \
    --cc=gcc-patches@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).