This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] PR 30835


Hello,

we ICE in can_convert_to_perfect_nest since we access the block returned
by bb_for_stmt directly; however, if the statement is a fake statement
that defines the initial value of a function parameter, then bb_for_stmt
is NULL.  Bootstrapped & regtested on i686, commited.

Zdenek

	PR tree-optimization/30835
	* lambda-code.c (can_convert_to_perfect_nest): Check whether
	bb_for_stmt is not NULL before accessing it.

Index: lambda-code.c
===================================================================
*** lambda-code.c	(revision 122807)
--- lambda-code.c	(working copy)
*************** can_convert_to_perfect_nest (struct loop
*** 2363,2370 ****
  			      {
  				tree arg_stmt = SSA_NAME_DEF_STMT (arg);
  
! 				if (bb_for_stmt (arg_stmt)->loop_father
! 				    == loop->inner)
  				  goto fail;
  			      }
  			  }
--- 2363,2371 ----
  			      {
  				tree arg_stmt = SSA_NAME_DEF_STMT (arg);
  
! 				if (bb_for_stmt (arg_stmt)
! 				    && (bb_for_stmt (arg_stmt)->loop_father
! 					== loop->inner))
  				  goto fail;
  			      }
  			  }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]