PR tree-optimization/46785
* tree-vect-loop.c (vect_is_simple_reduction_1): Also allow
call statements as operand definition.
* gcc.dg/vect/fast-math-vect-reduc-9.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167486
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-12-06 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/46785
+ * tree-vect-loop.c (vect_is_simple_reduction_1): Also allow
+ call statements as operand definition.
+
2010-12-06 Mingjie Xing <mingjie.xing@gmail.com>
* doc/tm.texi.in: Fix typo.
+2010-12-06 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/46785
+ * gcc.dg/vect/fast-math-vect-reduc-9.c: New testcase.
+
2010-12-06 Dave Korn <dave.korn.cygwin@gmail.com>
* gcc.dg/pr46674.c (LABEL3): New macro definition.
--- /dev/null
+/* { dg-require-effective-target vect_float } */
+
+#include "tree-vect.h"
+
+float x[1024];
+float
+test (void)
+{
+ int i;
+ float gosa = 0.0;
+ for (i = 0; i < 1024; ++i)
+ {
+ float tem = x[i];
+ gosa += tem * tem;
+ }
+ return gosa;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ if (test () != 0.0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
&& (code == COND_EXPR
|| (def1 && flow_bb_inside_loop_p (loop, gimple_bb (def1))
&& (is_gimple_assign (def1)
+ || is_gimple_call (def1)
|| STMT_VINFO_DEF_TYPE (vinfo_for_stmt (def1))
== vect_induction_def
|| (gimple_code (def1) == GIMPLE_PHI
&& (code == COND_EXPR
|| (def2 && flow_bb_inside_loop_p (loop, gimple_bb (def2))
&& (is_gimple_assign (def2)
+ || is_gimple_call (def2)
|| STMT_VINFO_DEF_TYPE (vinfo_for_stmt (def2))
== vect_induction_def
|| (gimple_code (def2) == GIMPLE_PHI