+2010-08-12 Changpeng Fang <changpeng.fang@amd.com>
+
+ * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Give
+ up dot_prod pattern searching if a stmt is outside the loop.
+
2010-08-12 H.J. Lu <hongjiu.lu@intel.com>
Uros Bizjak <ubizjak@gmail.com>
+2010-08-12 Changpeng Fang <changpeng.fang@amd.com>
+
+ PR tree-optimization/45241
+ * gcc.dg/vect/no-tree-pre-pr45241.c: New test.
+
2010-08-12 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/pr40906-1.c: Add -fno-asynchronous-unwind-tables
--- /dev/null
+/* PR tree-optimization/45241 */
+/* { dg-do compile } */
+/* { dg-options "-ftree-vectorize" } */
+
+int
+foo (short x)
+{
+ short i, y;
+ int sum;
+
+ for (i = 0; i < x; i++)
+ y = x * i;
+
+ for (i = x; i > 0; i--)
+ sum += y;
+
+ return sum;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
prod_type = half_type;
stmt = SSA_NAME_DEF_STMT (oprnd0);
+
+ /* It could not be the dot_prod pattern if the stmt is outside the loop. */
+ if (!flow_bb_inside_loop_p (loop, gimple_bb (stmt)))
+ return NULL;
+
/* FORNOW. Can continue analyzing the def-use chain when this stmt in a phi
inside the loop (in case we are analyzing an outer-loop). */
if (!is_gimple_assign (stmt))