diff options
| author | Andrew Pinski <andrew.pinski@oss.qualcomm.com> | 2025-10-30 17:46:54 -0700 |
|---|---|---|
| committer | Andrew Pinski <andrew.pinski@oss.qualcomm.com> | 2025-10-30 21:42:09 -0700 |
| commit | 7b9d32aa2ffcb5b02643b280c8404020c1e9d6b2 (patch) | |
| tree | b241f08ab0e63cb96cfdd6b9b90e81390323a47d /contrib/gcc-changelog/git_commit.py | |
| parent | 2be505ace7e5e29a29ab53025762cf1a100a6d76 (diff) | |
| download | gcc-7b9d32aa2ffcb5b02643b280c8404020c1e9d6b2.zip gcc-7b9d32aa2ffcb5b02643b280c8404020c1e9d6b2.tar.gz gcc-7b9d32aa2ffcb5b02643b280c8404020c1e9d6b2.tar.bz2 | |
sccp: Fix ICE during folding after proping const in some cases [PR122497]
In this case we originally had:
```
# g_4.3_21 = PHI <g_4.3_12(3)>
_1 = g_4.3_21 + 2;
_2 = g_2[_1][g_4.3_21];
```
SCCP figures out g_4.3_12/g_4.3_21 is 1.
final_value_replacement_loop would remove the phi defining _12.
do the constant prop of the const 1 but that would ICE as we try
to fold the reference `g_2[_1][g_4.3_21]` but that would try to see
the range of `_1` but since `_1` refers back to _21 there would be an
ICE as the phi is already been removed.
The obvious fix is to move the constant prop until after the new statement
for _21 is created.
This fixes the change done by r14-6010-g2dde9f326ded84 and r14-6114-gde0ab339a79535.
This does not fix gcc.dg/graphite/pr82819.c nor tr2/dynamic_bitset/pr92059.cc though;
I will look into those issues in a few.
Pushed as obvious after bootstrap/test.
PR tree-optimization/122497
gcc/ChangeLog:
* tree-scalar-evolution.cc (final_value_replacement_loop): Call replace_uses_by
only after the replacement statement was created.
gcc/testsuite/ChangeLog:
* gcc.dg/torture/pr122497-1.c: New test.
Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
Diffstat (limited to 'contrib/gcc-changelog/git_commit.py')
0 files changed, 0 insertions, 0 deletions
