tags 670164 fixed-upstream patch thanks I've attached the patch from upstream (only the fix, not the testcase). I've checked that it solves the problem.
-- Vincent Lefèvre <vinc...@vinc17.net> - Web: <http://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
2012-04-10 Ulrich Weigand <ulrich.weig...@linaro.org> PR tree-optimization/52870 * tree-vect-patterns.c (vect_recog_widen_mult_pattern): Verify that presumed pattern statement is within the same loop or basic block. --- a/src/gcc/tree-vect-patterns.c 2012/04/10 10:41:00 186271 +++ b/src/gcc/tree-vect-patterns.c 2012/04/10 10:56:11 186272 @@ -564,6 +564,16 @@ VEC (tree, heap) *dummy_vec; bool op1_ok; bool promotion; + loop_vec_info loop_vinfo; + struct loop *loop = NULL; + bb_vec_info bb_vinfo; + stmt_vec_info stmt_vinfo; + + stmt_vinfo = vinfo_for_stmt (last_stmt); + loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo); + bb_vinfo = STMT_VINFO_BB_VINFO (stmt_vinfo); + if (loop_vinfo) + loop = LOOP_VINFO_LOOP (loop_vinfo); if (!is_gimple_assign (last_stmt)) return NULL; @@ -635,6 +645,11 @@ || gimple_assign_rhs_code (use_stmt) != NOP_EXPR) return NULL; + if (!gimple_bb (use_stmt) + || (loop && !flow_bb_inside_loop_p (loop, gimple_bb (use_stmt))) + || (!loop && gimple_bb (use_stmt) != BB_VINFO_BB (bb_vinfo))) + return NULL; + use_lhs = gimple_assign_lhs (use_stmt); use_type = TREE_TYPE (use_lhs); if (!INTEGRAL_TYPE_P (use_type)