tree-optimization/112827 - corrupt SCEV cache during SCCP
commitde0ab339a795352c843f6e9b2dfce222f26588de
authorRichard Biener <rguenther@suse.de>
Mon, 4 Dec 2023 09:46:11 +0000 (4 10:46 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 4 Dec 2023 11:53:55 +0000 (4 12:53 +0100)
tree9ef451aa44f70cf0b093a79961dcdb7ddd3241ed
parent7804b4e24cd16283067225d4c2c4a4483a2b31bc
tree-optimization/112827 - corrupt SCEV cache during SCCP

The following avoids corrupting the SCEV cache by my last change
to propagate constant final values immediately.  The easiest fix
is to keep a dead initialization around.

PR tree-optimization/112827
* tree-scalar-evolution.cc (final_value_replacement_loop):
Do not release SSA name but keep a dead initialization around.

* gcc.dg/torture/pr112827-1.c: New testcase.
* gcc.dg/torture/pr112827-2.c: Likewise.
gcc/testsuite/gcc.dg/torture/pr112827-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr112827-2.c [new file with mode: 0644]
gcc/tree-scalar-evolution.cc