+2018-08-09 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR tree-optimization/86858
+ * tree-vect-loop.c (vect_is_simple_reduction): Restore
+ flow_bb_inside_loop_p calls.
+
2018-08-09 Richard Sandiford <richard.sandiford@arm.com>
PR tree-optimization/86871
+2018-08-09 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR tree-optimization/86858
+ * gcc.dg/vect/pr86858.c: New test.
+
2018-08-09 Richard Sandiford <richard.sandiford@arm.com>
PR tree-optimization/86871
--- /dev/null
+/* { dg-do compile } */
+
+int a, b, c, d;
+char e(char f, char g) { return f + g; }
+void h() {
+ for (; c; ++c) {
+ d = 0;
+ for (; d != 8; d = e(d, 3)) {
+ a = b && a;
+ b = c;
+ }
+ }
+}
}
stmt_vec_info def_stmt_info = loop_info->lookup_def (loop_arg);
- if (!def_stmt_info)
+ if (!def_stmt_info
+ || !flow_bb_inside_loop_p (loop, gimple_bb (def_stmt_info->stmt)))
return NULL;
if (gassign *def_stmt = dyn_cast <gassign *> (def_stmt_info->stmt))
&& def2_info->stmt == phi
&& (code == COND_EXPR
|| !def1_info
+ || !flow_bb_inside_loop_p (loop, gimple_bb (def1_info->stmt))
|| vect_valid_reduction_input_p (def1_info)))
{
if (dump_enabled_p ())
&& def1_info->stmt == phi
&& (code == COND_EXPR
|| !def2_info
+ || !flow_bb_inside_loop_p (loop, gimple_bb (def2_info->stmt))
|| vect_valid_reduction_input_p (def2_info)))
{
if (! nested_in_vect_loop && orig_code != MINUS_EXPR)