+2019-07-31 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/91293
+ * tree-vect-slp.c (vect_build_slp_tree_2): Do not swap operands
+ of reduction stmts.
+
2019-07-31 Matt Thomas <matt@3am-software.com>
Nick Hudson <nick@nthcliff.demon.co.uk>
Matthew Green <mrg@eterna.com.au>
+2019-07-31 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/91293
+ * gcc.dg/vect/pr91293-1.c: New testcase.
+ * gcc.dg/vect/pr91293-2.c: Likewise.
+ * gcc.dg/vect/pr91293-3.c: Likewise.
+
2019-07-31 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/91201
--- /dev/null
+/* { dg-do run } */
+/* { dg-additional-options "-msse4.1" { target { sse4_runtime } } } */
+
+long long a;
+unsigned b, c;
+int d = 62;
+void e(long long *f, int p2) { *f = p2; }
+int main()
+{
+ for (int g = 2; g <= d; g++)
+ {
+ b += g + 4;
+ c += 5 - g;
+ }
+ e(&a, b);
+ if (a != 2196)
+ __builtin_abort ();
+ return 0;
+}
--- /dev/null
+/* { dg-do run } */
+/* { dg-additional-options "-msse4.1" { target { sse4_runtime } } } */
+
+long long a;
+unsigned b, c;
+int d = 62;
+void e(long long *f, int p2) { *f = p2; }
+int main()
+{
+ for (int g = 2; g <= d; g++)
+ {
+ c += 5 - g;
+ b += g + 4;
+ }
+ e(&a, b);
+ if (a != 2196)
+ __builtin_abort ();
+ return 0;
+}
--- /dev/null
+/* { dg-do run } */
+/* { dg-additional-options "-msse4.1" { target { sse4_runtime } } } */
+
+long long a;
+unsigned b, c;
+int d = 62;
+void e(long long *f, int p2) { *f = p2; }
+int xx = 5, yy = 4;
+int main()
+{
+ for (int g = 2; g <= d; g++)
+ {
+ c += xx - g;
+ b += yy + g;
+ }
+ e(&a, b);
+ if (a != 2196)
+ __builtin_abort ();
+ return 0;
+}
&& nops == 2
&& oprnds_info[1]->first_dt == vect_internal_def
&& is_gimple_assign (stmt_info->stmt)
+ /* Swapping operands for reductions breaks assumptions later on. */
+ && STMT_VINFO_DEF_TYPE (stmt_info) != vect_reduction_def
+ && STMT_VINFO_DEF_TYPE (stmt_info) != vect_double_reduction_def
/* Do so only if the number of not successful permutes was nor more
than a cut-ff as re-trying the recursive match on
possibly each level of the tree would expose exponential