This code is triggred only when *all* arguments of a PHI are pointers to the same object   We should set points to info only when it doesn't already point at something.  The opposite was being done, probably a result of reworking the API and missing this inversion..

Bootstrapped on x86_64-pc-linux-gnu with no regressions.  pushed.

Andrew
From 6e41ade84681a326ffbc41480b099e22176157d0 Mon Sep 17 00:00:00 2001
From: Andrew MacLeod <[email protected]>
Date: Wed, 17 Jun 2026 20:19:19 -0400
Subject: [PATCH 2/2] Fix typo in range_of_phi.

We should set points to info when it doesnt already point at something.
The opposite was being done.

	* gimple-range-fold.cc (fold_using_range::range_of_phi): Remove
	extranous logical not from expression.
---
 gcc/gimple-range-fold.cc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc
index 50cee517120..5a2736c6ebc 100644
--- a/gcc/gimple-range-fold.cc
+++ b/gcc/gimple-range-fold.cc
@@ -1266,8 +1266,7 @@ fold_using_range::range_of_phi (vrange &r, gphi *phi, fur_source &src)
 	    {
 	      prange &ptr = as_a <prange> (arg_range);
 	      // If it doesn't already point at something, set points to.
-	      if (!ptr.pt_unknown_p ()
-		  && TREE_CODE (single_arg) == ADDR_EXPR)
+	      if (ptr.pt_unknown_p () && TREE_CODE (single_arg) == ADDR_EXPR)
 		ptr.set_pt (single_arg, true);
 	      r = ptr;
 	      return true;
-- 
2.45.0

Reply via email to