diff options
author | Richard Biener <rguenther@suse.de> | 2020-05-27 13:05:07 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2020-05-27 14:56:43 +0200 |
commit | 6c8e16aea85286721eb5689f9bcae09d36003cb1 (patch) | |
tree | 5ba8850a16c0471d29e9772abbe218c45acf3286 /gcc/tree-ssa-loop-im.c | |
parent | 116e3cfc7b8ab8afc4bdbc03db6b194413218af7 (diff) | |
download | gcc-6c8e16aea85286721eb5689f9bcae09d36003cb1.zip gcc-6c8e16aea85286721eb5689f9bcae09d36003cb1.tar.gz gcc-6c8e16aea85286721eb5689f9bcae09d36003cb1.tar.bz2 |
tree-optimization/95295 - fix sinking after path merging in new SM code
This fixes a missed sinking of remat stores across unrelated stores
after merging from different paths.
2020-05-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/95295
* tree-ssa-loop-im.c (sm_seq_valid_bb): Fix sinking after
merging stores from paths.
* gcc.dg/torture/pr95295-3.c: New testcase.
Diffstat (limited to 'gcc/tree-ssa-loop-im.c')
-rw-r--r-- | gcc/tree-ssa-loop-im.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c index b399bd0..d33f533 100644 --- a/gcc/tree-ssa-loop-im.c +++ b/gcc/tree-ssa-loop-im.c @@ -2447,12 +2447,16 @@ sm_seq_valid_bb (class loop *loop, basic_block bb, tree vdef, unsigned id = first_edge_seq[i].first; seq.safe_push (first_edge_seq[i]); unsigned new_idx; - if (first_edge_seq[i].second == sm_ord + if ((first_edge_seq[i].second == sm_ord + || (first_edge_seq[i].second == sm_other + && first_edge_seq[i].from != NULL_TREE)) && !sm_seq_push_down (seq, seq.length () - 1, &new_idx)) { - bitmap_set_bit (refs_not_supported, id); + if (first_edge_seq[i].second == sm_ord) + bitmap_set_bit (refs_not_supported, id); /* Mark it sm_other. */ seq[new_idx].second = sm_other; + seq[new_idx].from = NULL_TREE; } } return 1; |