new file mode 100644
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+
+int a;
+char b;
+long c, d, e;
+unsigned long f;
+long g() {
+ if (a <= 0)
+ return 1;
+ for (; d; d++) {
+ e = 0;
+ for (; e < a; e++) {
+ unsigned long h = 0;
+ switch (b)
+ case 2:
+ if (e)
+ h = 5;
+ c += h;
+ }
+ }
+ c /= f;
+}
@@ -19,5 +19,5 @@ nr (int xe)
return xe;
}
-/* { dg-final { scan-tree-dump "reduction used in loop" "vect" { target vect_int } } } */
+/* { dg-final { scan-tree-dump "Unknown def-use cycle pattern" "vect" { target vect_int } } } */
/* { dg-final { scan-tree-dump-not "OUTER LOOP VECTORIZED" "vect" } } */
@@ -19,5 +19,5 @@ nr (unsigned int xe, unsigned int qqn)
return xe;
}
-/* { dg-final { scan-tree-dump "reduction used in loop" "vect" { target vect_int } } } */
+/* { dg-final { scan-tree-dump "Unknown def-use cycle pattern" "vect" { target vect_int } } } */
/* { dg-final { scan-tree-dump-not "OUTER LOOP VECTORIZED" "vect" } } */
@@ -4342,7 +4342,8 @@ vect_is_simple_reduction (loop_vec_info loop_info, stmt_vec_info phi_info,
&& is_a <gphi *> (phi_use_stmt)
&& flow_bb_inside_loop_p (loop->inner, gimple_bb (phi_use_stmt))
&& (op1 == PHI_ARG_DEF_FROM_EDGE (phi_use_stmt,
- loop_latch_edge (loop->inner))))
+ loop_latch_edge (loop->inner)))
+ && lcphis.length () == 1)
{
if (dump_enabled_p ())
report_vect_op (MSG_NOTE, def_stmt,