2019-10-28 Richard Biener <rguenther@suse.de>
+ PR tree-optimization/92252
+ * tree-vect-slp.c (vect_get_and_check_slp_defs): Adjust
+ STMT_VINFO_REDUC_IDX when swapping operands.
+
+2019-10-28 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/92241
* tree-vect-loop.c (vect_fixup_scalar_cycles_with_patterns): When
we failed to update the reduction index do not use the pattern
2019-10-28 Richard Biener <rguenther@suse.de>
+ PR tree-optimization/92252
+ * gcc.dg/torture/pr92252.c: New testcase.
+
+2019-10-28 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/92241
* gcc.dg/torture/pr92241.c: New testcase.
--- /dev/null
+/* { do-do compile } */
+/* { dg-additional-options "-ftree-vectorize" } */
+
+long int ar;
+int dt;
+
+long int
+pc (unsigned long int q3, int zw)
+{
+ long int em = 0;
+
+ while (zw < 1)
+ {
+ q3 = zw * 2ul;
+ if (q3 != 0)
+ for (ar = 0; ar < 2; ++ar)
+ em = dt;
+
+ ++zw;
+ }
+
+ return em;
+}
{
swap_ssa_operands (stmt, gimple_assign_rhs2_ptr (stmt),
gimple_assign_rhs3_ptr (stmt));
+ if (STMT_VINFO_REDUC_IDX (stmt_info) == 1)
+ STMT_VINFO_REDUC_IDX (stmt_info) = 2;
+ else if (STMT_VINFO_REDUC_IDX (stmt_info) == 2)
+ STMT_VINFO_REDUC_IDX (stmt_info) = 1;
bool honor_nans = HONOR_NANS (TREE_OPERAND (cond, 0));
code = invert_tree_comparison (TREE_CODE (cond), honor_nans);
gcc_assert (code != ERROR_MARK);