tree-optimization/95295 - fix wrong-code with SM
authorRichard Biener <rguenther@suse.de>
Mon, 25 May 2020 08:09:44 +0000 (10:09 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 25 May 2020 11:39:26 +0000 (13:39 +0200)
commit4acca1c0635dfa43cd8c4bfe2b22e17909fc23a3
tree74b0f5c61cae3185360a3aeb84c50605cd09f46c
parentc0e27f72358794692e367363940c6383e9ad1e45
tree-optimization/95295 - fix wrong-code with SM

We failed to compare the rematerialized store values when merging
paths after walking PHIs.

2020-05-25  Richard Biener  <rguenther@suse.de>

PR tree-optimization/95295
* tree-ssa-loop-im.c (sm_seq_valid_bb): Compare remat stores
RHSes and drop to full sm_other if they are not equal.

* gcc.dg/torture/pr95295-1.c: New testcase.
* gcc.dg/torture/pr95295-2.c: Likewise.
* gcc.dg/torture/pr95283.c: Likewise.
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr95283.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr95295-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr95295-2.c [new file with mode: 0644]
gcc/tree-ssa-loop-im.c