[PATCH] Fix PR59951

Richard Biener rguenther@suse.de
Thu Jan 30 11:54:00 GMT 2014


This fixes PR59951, a debug-compare failure where we didn't disregard
uses in debug stmts when accounting for SLP uses outside of the slp.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2014-01-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/59951
	* tree-vect-slp.c (vect_bb_slp_scalar_cost): Skip uses in debug
	insns.

Index: gcc/tree-vect-slp.c
===================================================================
*** gcc/tree-vect-slp.c	(revision 207238)
--- gcc/tree-vect-slp.c	(working copy)
*************** vect_bb_slp_scalar_cost (basic_block bb,
*** 1967,1975 ****
  	  imm_use_iterator use_iter;
  	  gimple use_stmt;
  	  FOR_EACH_IMM_USE_STMT (use_stmt, use_iter, DEF_FROM_PTR (def_p))
! 	    if (gimple_code (use_stmt) == GIMPLE_PHI
! 		|| gimple_bb (use_stmt) != bb
! 		|| !STMT_VINFO_VECTORIZABLE (vinfo_for_stmt (use_stmt)))
  	      {
  		(*life)[i] = true;
  		BREAK_FROM_IMM_USE_STMT (use_iter);
--- 1967,1976 ----
  	  imm_use_iterator use_iter;
  	  gimple use_stmt;
  	  FOR_EACH_IMM_USE_STMT (use_stmt, use_iter, DEF_FROM_PTR (def_p))
! 	    if (!is_gimple_debug (use_stmt)
! 		&& (gimple_code (use_stmt) == GIMPLE_PHI
! 		    || gimple_bb (use_stmt) != bb
! 		    || !STMT_VINFO_VECTORIZABLE (vinfo_for_stmt (use_stmt))))
  	      {
  		(*life)[i] = true;
  		BREAK_FROM_IMM_USE_STMT (use_iter);



More information about the Gcc-patches mailing list