------- Comment #1 from changpeng dot fang at amd dot com  2010-08-09 17:52 
-------
This patch should be a valid fix, because the recognition of the dot_prod
pattern is known to be fail at this point if the stmt is outside the loop.
(I am not sure whether we should not see this case in the vectorizer at this
point -- should previous analysis already filter out?):

diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 19f0ae6..5f81a73 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -259,6 +259,10 @@ vect_recog_dot_prod_pattern (gimple last_stmt, tree
*type_in, tree *type_out)
      inside the loop (in case we are analyzing an outer-loop).  */
   if (!is_gimple_assign (stmt))
     return NULL;
+
+  if (!flow_bb_inside_loop_p (loop, gimple_bb (stmt)))
+    return NULL;
+
   stmt_vinfo = vinfo_for_stmt (stmt);
   gcc_assert (stmt_vinfo);
   if (STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_internal_def)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45241

Reply via email to