tree-optimization/112827 - more SCEV cprop fixes
commit50f2a3370d177f8fe9bea0461feb710523e048a2
authorRichard Biener <rguenther@suse.de>
Mon, 4 Dec 2023 14:46:38 +0000 (4 15:46 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 5 Dec 2023 07:26:04 +0000 (5 08:26 +0100)
tree60963967b0fce26e03de85a45388aec1238bff0f
parentb1cb2d993cc1148281fb4922a7ae26a4ae9ecf6f
tree-optimization/112827 - more SCEV cprop fixes

The insert iteration can be corrupted by foldings of replace_uses_by,
within this particular PHI replacement but also with subsequent ones.
Recompute the insert location before insertion instead.

This fixes an obvserved ICE of gcc.dg/tree-ssa/ssa-sink-16.c.

PR tree-optimization/112827
PR tree-optimization/112848
* tree-scalar-evolution.cc (final_value_replacement_loop):
Compute the insert location for each insert.
gcc/tree-scalar-evolution.cc