Fix PRs 57478 / 57453

Submitted by Richard Guenther on May 31, 2013, 8:54 a.m.

Details

Message ID alpine.LNX.2.00.1305311053250.5472@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Guenther May 31, 2013, 8:54 a.m.
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  <rguenther@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.

Patch hide | download patch | download mbox

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;