+2016-01-14 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/68060
+ * tree-vect-loop.c (vect_is_simple_reduction): Check the
+ outer loop reduction is only used in the inner loop before
+ detecting a double reduction.
+
2016-01-14 Jakub Jelinek <jakub@redhat.com>
PR target/68269
+2016-01-14 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/68060
+ * gcc.dg/torture/pr68060-1.c: New testcase.
+ * gcc.dg/torture/pr68060-2.c: Likewise.
+
2016-01-14 Nick Clifton <nickc@redhat.com>
* lib/target-supports.exp
struct loop *vect_loop = LOOP_VINFO_LOOP (loop_info);
edge latch_e = loop_latch_edge (loop);
tree loop_arg = PHI_ARG_DEF_FROM_EDGE (phi, latch_e);
- gimple *def_stmt, *def1 = NULL, *def2 = NULL;
+ gimple *def_stmt, *def1 = NULL, *def2 = NULL, *phi_use_stmt = NULL;
enum tree_code orig_code, code;
tree op1, op2, op3 = NULL_TREE, op4 = NULL_TREE;
tree type;
"reduction used in loop.\n");
return NULL;
}
+
+ phi_use_stmt = use_stmt;
}
if (TREE_CODE (loop_arg) != SSA_NAME)
&& flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))
&& loop->inner
&& flow_bb_inside_loop_p (loop->inner, gimple_bb (def1))
- && is_gimple_assign (def1))
+ && is_gimple_assign (def1)
+ && flow_bb_inside_loop_p (loop->inner, gimple_bb (phi_use_stmt)))
{
if (dump_enabled_p ())
report_vect_op (MSG_NOTE, def_stmt,