--- /dev/null
+/* { dg-do compile } */
+/* { dg-additional-options "-O3 -fno-tree-reassoc" } */
+
+void
+crash_me (short int *crash_me_result, int i, char crash_me_ptr_0)
+{
+ while (i < 1)
+ {
+ int j;
+
+ for (j = 0; j < 2; ++j)
+ crash_me_result[j] += crash_me_ptr_0 + 1;
+
+ i += 3;
+ }
+}
= as_a <loop_vec_info> (vinfo)->reductions;
scalar_stmts.create (reductions.length ());
for (i = 0; reductions.iterate (i, &next_info); i++)
- if (STMT_VINFO_RELEVANT_P (next_info)
- || STMT_VINFO_LIVE_P (next_info))
+ if ((STMT_VINFO_RELEVANT_P (next_info)
+ || STMT_VINFO_LIVE_P (next_info))
+ /* ??? Make sure we didn't skip a conversion around a reduction
+ path. In that case we'd have to reverse engineer that conversion
+ stmt following the chain using reduc_idx and from the PHI
+ using reduc_def. */
+ && STMT_VINFO_DEF_TYPE (next_info) == vect_reduction_def)
scalar_stmts.quick_push (next_info);
/* If less than two were relevant/live there's nothing to SLP. */
if (scalar_stmts.length () < 2)
vinfo = next;
}
STMT_VINFO_DEF_TYPE (first_element) = vect_internal_def;
- /* It can be still vectorized as part of an SLP reduction.
- ??? But only if we didn't skip a conversion around the group.
- In that case we'd have to reverse engineer that conversion
- stmt following the chain using reduc_idx and from the PHI
- using reduc_def. */
- if (STMT_VINFO_DEF_TYPE (last) == vect_reduction_def)
- loop_vinfo->reductions.safe_push (last);
+ /* It can be still vectorized as part of an SLP reduction. */
+ loop_vinfo->reductions.safe_push (last);
}
/* Find SLP sequences starting from groups of reductions. */