tree-optimization/101088 - fix SM invalidation issue
authorRichard Biener <rguenther@suse.de>
Wed, 16 Jun 2021 07:49:18 +0000 (09:49 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 16 Jun 2021 09:28:03 +0000 (11:28 +0200)
commit43fc4234ad3d9302d3460385b6fdb5e3f59b6986
tree661666162ff00d6b54731fe458f1acb69077775f
parent3155d51bfd1de8b6c4645dcb2292248a8d7cc3c9
tree-optimization/101088 - fix SM invalidation issue

When we face a sm_ord vs sm_unord for the same ref during
store sequence merging we assert that the ref is already marked
unsupported.  But it can be that it will only be marked so
during the ongoing merging so instead of asserting mark it here.

Also apply some optimization to not waste resources to search
for already unsupported refs.

2021-06-16  Richard Biener  <rguenther@suse.de>

PR tree-optimization/101088
* tree-ssa-loop-im.c (sm_seq_valid_bb): Only look for
supported refs on edges.  Do not assert same ref but
different kind stores are unsuported but mark them so.
(hoist_memory_references): Only look for supported refs
on exits.

* gcc.dg/torture/pr101088.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr101088.c [new file with mode: 0644]
gcc/tree-ssa-loop-im.c