http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50208
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-29 10:44:42 UTC --- The problem is that def_stmt is a gimple stmt from before the loop and new_loop_vec_info only initializes gimple_uid of stmts in the loop being processed. So perhaps before testing for vinfo_for_stmt it should || !gimple_bb (def_stmt) || !flow_bb_inside_loop_p (loop, gimple_bb (def_stmt)) and perhaps give up in those cases too? Loop would need to be initialized, perhaps similarly to vect_recog_dot_prod_pattern? loop_vec_info loop_info = STMT_VINFO_LOOP_VINFO (vinfo_for_stmt (stmt)); struct loop *loop = LOOP_VINFO_LOOP (loop_info); ? I have no idea whether this can be invoked from slp vectorizer and what to do in that case.