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]

[tree-ssa] Make jump threading work over empty blocks


Hello,

optimize_block ices when the jump is threaded into empty block.

Zdenek

	* tree-ssa-dom.c (optimize_block): Thread jump into empty
	block correctly.

Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-dom.c,v
retrieving revision 1.1.2.27
diff -c -3 -p -r1.1.2.27 tree-ssa-dom.c
*** tree-ssa-dom.c	19 Aug 2003 19:03:24 -0000	1.1.2.27
--- tree-ssa-dom.c	19 Aug 2003 20:45:35 -0000
*************** optimize_block (basic_block bb, tree par
*** 481,492 ****
  	      if (dest && ! phi_nodes (dest))
  		{
  		  block_stmt_iterator dest_iterator = bsi_start (dest);
! 		  tree dest_stmt = bsi_stmt (dest_iterator);
  		  tree label, goto_stmt;
  
  		  /* We need a label at our final destination.  If it does
  		     not already exist, create it.  */
! 		  if (TREE_CODE (dest_stmt) != LABEL_EXPR)
  		    {
  		      label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
  		      DECL_CONTEXT (label) = current_function_decl;
--- 481,493 ----
  	      if (dest && ! phi_nodes (dest))
  		{
  		  block_stmt_iterator dest_iterator = bsi_start (dest);
! 		  tree dest_stmt = first_stmt (dest);
  		  tree label, goto_stmt;
  
  		  /* We need a label at our final destination.  If it does
  		     not already exist, create it.  */
! 		  if (!dest_stmt
! 		      || TREE_CODE (dest_stmt) != LABEL_EXPR)
  		    {
  		      label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
  		      DECL_CONTEXT (label) = current_function_decl;


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