The following fixes the bug I already fixed more thoroughly. Tested on x86_64-unknown-linux-gnu, committed as obvious.
Richard. 2013-05-31 Richard Biener <rguent...@suse.de> PR tree-optimization/57478 PR tree-optimization/57453 * tree-vect-slp.c (vect_bb_slp_scalar_cost): Uses in PHI nodes are life as well. Index: gcc/tree-vect-slp.c =================================================================== --- gcc/tree-vect-slp.c (revision 199403) +++ gcc/tree-vect-slp.c (working copy) @@ -1932,7 +1932,8 @@ vect_bb_slp_scalar_cost (basic_block bb, imm_use_iterator use_iter; gimple use_stmt; FOR_EACH_IMM_USE_STMT (use_stmt, use_iter, DEF_FROM_PTR (def_p)) - if (gimple_bb (use_stmt) != bb + if (gimple_code (use_stmt) == GIMPLE_PHI + || gimple_bb (use_stmt) != bb || !STMT_VINFO_VECTORIZABLE (vinfo_for_stmt (use_stmt))) { life[i] = true;