diff options
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr95295-3.c | 16 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-im.c | 8 |
2 files changed, 22 insertions, 2 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr95295-3.c b/gcc/testsuite/gcc.dg/torture/pr95295-3.c new file mode 100644 index 0000000..a506af9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr95295-3.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ + +extern short var_15, var_20; +extern int var_18, var_21, var_23; +extern _Bool arr_2[]; +extern long arr_3[]; +void test() +{ + var_20 = 1; + for (int a = 0; a < 12; a += 2) + for (short b = 0; b < 8; b += 2) { + arr_2[b] = var_21 = var_18 ? var_15 : 0; + arr_3[b] = 8569; + } + var_23 = -1096835496; +} 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; |