aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.dg/torture/pr102142.C9
-rw-r--r--gcc/tree-vect-slp.c2
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/testsuite/g++.dg/torture/pr102142.C b/gcc/testsuite/g++.dg/torture/pr102142.C
new file mode 100644
index 0000000..8e3ea5d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr102142.C
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+extern short arr_597[];
+extern bool arr_601[];
+int test_var_13;
+void test(short arr_391[][9][2][2]) {
+ for (int i_60 = 0; i_60 < 11; i_60 += test_var_13)
+ arr_597[22] = arr_601[i_60] = arr_391[0][0][1][4];
+}
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 4ca2440..fa3566f 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -5396,7 +5396,7 @@ vect_bb_vectorization_profitable_p (bb_vec_info bb_vinfo,
/* Unset visited flag. This is delayed when the subgraph is profitable
and we process the loop for remaining unvectorized if-converted code. */
- if (orig_loop && !profitable)
+ if (!orig_loop || !profitable)
FOR_EACH_VEC_ELT (scalar_costs, i, cost)
gimple_set_visited (cost->stmt_info->stmt, false);