tree-optimization/112444 - avoid bougs PHI value-numbering
commit8ebcea91e24964ec52ca2caf9f8585f3a785f7d5
authorRichard Biener <rguenther@suse.de>
Thu, 9 Nov 2023 08:41:10 +0000 (9 09:41 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 9 Nov 2023 10:48:32 +0000 (9 11:48 +0100)
treed9ab4a5e57fcda68b7116ac9466be0e821124caa
parenta0273d257ccf4d01997368d85f008094ab84db73
tree-optimization/112444 - avoid bougs PHI value-numbering

With .DEFERRED_INIT ssa_undefined_value_p () can return true for
values we did not visit (because they proved unreachable) but
are not .VN_TOP.  Avoid using those as value which, because they
are not visited, are assumed to be defined outside of the region.

PR tree-optimization/112444
* tree-ssa-sccvn.cc (visit_phi): Avoid using not visited
defs as undefined vals.

* gcc.dg/torture/pr112444.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr112444.c [new file with mode: 0644]
gcc/tree-ssa-sccvn.cc