------- Comment #5 from irar at il dot ibm dot com 2010-08-10 10:23 ------- (In reply to comment #1) > 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?): >
I don't understand this. Where do we check if the stmt (which one?) is outside the loop? > 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) > I was looking at PR 45239 and didn't notice that there is another PR and didn't see this comment. So I tested the same fix (successfully on x86_64-suse-linux). You can commit it if you like (just please notice, that the bug exists on 4.5 as well). Thanks, Ira -- irar at il dot ibm dot com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2010-08-10 10:24:00 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45241