2011-09-09 Richard Guenther <rguenther@suse.de>
+ PR tree-optimization/50328
+ * tree-vect-loop.c (vect_is_simple_reduction_1): Allow one
+ constant or default-def operand.
+
+2011-09-09 Richard Guenther <rguenther@suse.de>
+
* tree-ssa-pre.c (create_expression_by_pieces): Fold the
last statement.
2011-09-09 Richard Guenther <rguenther@suse.de>
+ PR tree-optimization/50328
+ * gcc.dg/vect/fast-math-vect-outer-7.c: New testcase.
+
+2011-09-09 Richard Guenther <rguenther@suse.de>
+
PR middle-end/50333
* gcc.dg/torture/pr50333.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+float dvec[256];
+
+void test1 (float x)
+{
+ long i, j;
+ for (i = 0; i < 256; ++i)
+ for (j = 0; j < 131072; ++j)
+ dvec[i] *= x;
+}
+
+void test2 (float x)
+{
+ long i, j;
+ for (i = 0; i < 256; ++i)
+ for (j = 0; j < 131072; ++j)
+ dvec[i] *= 1.001f;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
op1 = gimple_assign_rhs1 (def_stmt);
op2 = gimple_assign_rhs2 (def_stmt);
- if (TREE_CODE (op1) != SSA_NAME || TREE_CODE (op2) != SSA_NAME)
+ if (TREE_CODE (op1) != SSA_NAME && TREE_CODE (op2) != SSA_NAME)
{
if (vect_print_dump_info (REPORT_DETAILS))
report_vect_op (def_stmt, "reduction: uses not ssa_names: ");
def2 = SSA_NAME_DEF_STMT (op2);
if (code != COND_EXPR
- && (!def1 || !def2 || gimple_nop_p (def1) || gimple_nop_p (def2)))
+ && ((!def1 || gimple_nop_p (def1)) && (!def2 || gimple_nop_p (def2))))
{
if (vect_print_dump_info (REPORT_DETAILS))
report_vect_op (def_stmt, "reduction: no defs for operands: ");
if (def2 && def2 == phi
&& (code == COND_EXPR
+ || !def1 || gimple_nop_p (def1)
|| (def1 && flow_bb_inside_loop_p (loop, gimple_bb (def1))
&& (is_gimple_assign (def1)
|| is_gimple_call (def1)
if (def1 && def1 == phi
&& (code == COND_EXPR
+ || !def2 || gimple_nop_p (def2)
|| (def2 && flow_bb_inside_loop_p (loop, gimple_bb (def2))
&& (is_gimple_assign (def2)
|| is_gimple_call (def2)