https://gcc.gnu.org/g:2bd2f7c5b36b867f6f71304f2fa2787684b7e28d

commit r17-5956-g2bd2f7c5b36b867f6f71304f2fa2787684b7e28d
Author: Andrew MacLeod <[email protected]>
Date:   Wed Nov 4 11:26:04 2026 -0500

    segregate duplication of pt_solution from ranges.
    
    pt_solution has a different lifecycle than the range, and duplicating
    one can be independent of the other.   This patch completes the
    segregation and only combines them at the appropriate places.
    
            * tree-ssanames.cc (duplicate_ssa_name_range_info): Do not copy
            the pt_solution field.
            (maybe_duplicate_ssa_info_at_copy): Copy both.
            (duplicate_ssa_name_fn): Copy both.

Diff:
---
 gcc/tree-ssanames.cc | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/gcc/tree-ssanames.cc b/gcc/tree-ssanames.cc
index 306e61c2bd5e..71ef88ae21ba 100644
--- a/gcc/tree-ssanames.cc
+++ b/gcc/tree-ssanames.cc
@@ -953,7 +953,7 @@ copy_ssa_name_fn (struct function *fn, tree name, gimple 
*stmt)
   return new_name;
 }
 
-/* Give DEST its own copy of the points-to and alignment information of
+/* Give DEST its own copy of the points-to information of
    the SSA name SRC.  SRC may be NULL_TREE or carry no information, in
    which case DEST is left alone.  */
 
@@ -970,7 +970,7 @@ duplicate_ssa_name_ptr_info (tree dest, const pt_solution* 
pt)
   set_pt_solution (dest, copy);
 }
 
-/* Give DEST its own copy of the points-to and alignment information of
+/* Give DEST its own copy of the points-to information of
    the SSA name SRC.  SRC may be NULL_TREE or carry no information, in
    which case DEST is left alone.  */
 
@@ -984,7 +984,7 @@ duplicate_ssa_name_ptr_info (tree dest, tree src)
     duplicate_ssa_name_ptr_info (dest, pt);
 }
 
-/* Copy any global range and aliasing information from SRC to NAME.  */
+/* Copy any global range information from SRC to NAME.  */
 
 void
 duplicate_ssa_name_range_info (tree name, tree src)
@@ -998,11 +998,6 @@ duplicate_ssa_name_range_info (tree name, tree src)
   range_info_get_range (src, src_range);
   range_info_set_range (name, src_range);
 
-  /* For a pointer the aliasing info lives in the storage just created,
-     so it has to be copied as part of the same operation.  */
-  if (POINTER_TYPE_P (TREE_TYPE (src)))
-    duplicate_ssa_name_ptr_info (name, src);
-
   unsigned align, misalign;
   if (get_ptr_info_alignment (src, &align, &misalign))
      set_ptr_info_alignment (name, align, misalign);
@@ -1021,7 +1016,10 @@ maybe_duplicate_ssa_info_at_copy (tree dest, tree src)
     return;
 
   if (SSA_NAME_RANGE_INFO (dest) && !SSA_NAME_RANGE_INFO (src))
-    duplicate_ssa_name_range_info (src, dest);
+    {
+      duplicate_ssa_name_range_info (src, dest);
+      duplicate_ssa_name_ptr_info (src, dest);
+    }
 }
 
 
@@ -1034,7 +1032,10 @@ duplicate_ssa_name_fn (struct function *fn, tree name, 
gimple *stmt)
   tree new_name = copy_ssa_name_fn (fn, name, stmt);
 
   if (SSA_NAME_RANGE_INFO (name))
-    duplicate_ssa_name_range_info (new_name, name);
+    {
+      duplicate_ssa_name_range_info (new_name, name);
+      duplicate_ssa_name_ptr_info (new_name, name);
+    }
 
   return new_name;
 }

Reply via email to