https://gcc.gnu.org/g:b7103fc3cebb57b0f267c6c1e323e048117ecf30

commit r17-5955-gb7103fc3cebb57b0f267c6c1e323e048117ecf30
Author: Andrew MacLeod <[email protected]>
Date:   Fri Oct 30 18:05:16 2026 -0400

    Verify range and pt_solution pointers
    
    The current ssa-name verifier is not checking frange nor prange, and
    can now verify pt_solution seperately.
    
            * tree-ssa.cc (verify_ssa): Verify ranges and pt_solution.

Diff:
---
 gcc/tree-ssa.cc | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/gcc/tree-ssa.cc b/gcc/tree-ssa.cc
index 1be5290c85f1..e1c15283e5c7 100644
--- a/gcc/tree-ssa.cc
+++ b/gcc/tree-ssa.cc
@@ -1093,11 +1093,24 @@ verify_ssa (bool check_modified_stmt, bool 
check_ssa_operands)
                goto err;
            }
 
-         const void *info = NULL;
-         if (POINTER_TYPE_P (TREE_TYPE (name)))
-           info = ssa_name_pt_solution (name);
-         else if (INTEGRAL_TYPE_P (TREE_TYPE (name)))
-           info = SSA_NAME_RANGE_INFO (name);
+         const pt_solution *pt_info = ssa_name_pt_solution (name);
+         if (pt_info)
+           {
+             bool existed;
+             tree &val = ssa_info.get_or_insert (pt_info, &existed);
+             if (existed)
+               {
+                 error ("shared SSA name pt_solution info");
+                 print_generic_expr (stderr, val);
+                 fprintf (stderr, " and ");
+                 print_generic_expr (stderr, name);
+                 fprintf (stderr, "\n");
+                 goto err;
+               }
+             else
+               val = name;
+           }
+         const void *info = SSA_NAME_RANGE_INFO (name);
          if (info)
            {
              bool existed;

Reply via email to