]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
middle-end/108086 - avoid unshare_expr when remapping SSA names
authorRichard Biener <rguenther@suse.de>
Fri, 16 Dec 2022 12:01:40 +0000 (13:01 +0100)
committerRichard Biener <rguenther@suse.de>
Fri, 16 Dec 2022 12:05:48 +0000 (13:05 +0100)
r0-89280-g129a37fc319db8 added unsharing to remap_ssa_name but
that wasn't in the version of the patch posted.  That has some
non-trivial cost through mostly_copy_tree_r and copy_tree_r but
more importantly it doesn't seem to be necessary.  I've successfully
bootstrapped and tested with an assert we only get
tree_node_can_be_shared trees here.

Bootstrapped and tested on x86_64-unknown-linux-gnu with all
languages.

PR middle-end/108086
* tree-inline.cc (remap_ssa_name): Do not unshare the
result from the decl_map.

gcc/tree-inline.cc

index 9fd971a034ceab4d26d40099ac224bc16cd0c1c3..c6c86af6c4ea9c63a1cb20f29b07732fefd74f31 100644 (file)
@@ -183,7 +183,7 @@ remap_ssa_name (tree name, copy_body_data *id)
          return name;
        }
 
-      return unshare_expr (*n);
+      return *n;
     }
 
   if (processing_debug_stmt)