[tree-ssa] unsharing empty_stmt_node (part 2)

Diego Novillo dnovillo@redhat.com
Fri May 2 14:29:00 GMT 2003


This is a follow up to the patch that makes empty statements
first-class objects in the IL
(http://gcc.gnu.org/ml/gcc-patches/2003-04/msg02266.html)

- The flow graph code will not treat empty statements like
  special cases.

- Removes most calls to STRIP_NOPS.  They're not necessary.

- Factors some code in the flow graph builder and iterators.

Bootstrapped and tested on x86, amd64 and ppc.  There are two new
libmudflap failures, but Frank tells me they are because the
optimizers are removing code that was going to be instrumented.
Adding volatile qualifiers to those testcases fixes the problem.


Diego.

	* tree-cfg.c (build_tree_cfg): Update comment.
	(make_blocks): Don't skip over empty statements.
	Move exception handling code ...
	(compute_reachable_eh): ... here.
	(set_parent_stmt): Don't skip over empty statements.
	(bsi_remove): Don't return early on empty statements.
	Don't call STRIP_NOPS.
	(remove_stmt): Don't call STRIP_NOPS.
	Always compute the block holding the statement.
	After replacing the statement with an empty statement, add the
	empty statement to the block.
	(successor_block): Don't call STRIP_NOPS.
	(first_exec_stmt): Likewise.
	(first_exec_block): Don't return early for empty statements.
	(first_stmt): Don't test for NULL blocks.
	Reformat to improve legibility.
	(bsi_next_in_bb): Don't call STRIP_NOPS.
	Reformat to improve legibility.
	(set_bb_for_stmt): Don't ignore empty statements.

	* tree-dfa.c (get_stmt_operands): Don't call STRIP_NOPS.
	(create_stmt_ann): Don't abort on emtpy statements.
	Don't call STRIP_NOPS.
	(copy_stmt): Remove unused function.
	* tree-flow.h (copy_stmt): Remove prototype.

	* tree-flow-inline.h: Don't call STRIP_NOPS.
	Remove local variable 't'.
	(bsi_stmt): Don't return NULL_TREE for empty statements.
	Ignore error_mark_node.

	* tree-iterator.h (tsi_next): Don't call STRIP_NOPS.
	(tsi_stmt_ptr): Likewise.
	(tsi_stmt): Likewise.
	Don't return NULL_TREE for empty statements.

	* tree-pretty-print.c (dump_generic_node): Don't ignore empty
	statements.

	* tree-ssa-ccp.c (fold_stmt): Don't call STRIP_NOPS.
	* tree-ssa-dce.c (find_useful_stmts): Likewise.
	(remove_dead_stmt): Likewise.
	* tree-ssa.c (mark_def_sites): Likewise.
	(rewrite_out_of_ssa): Likewise.
	(rewrite_stmt): Likewise.

	* tree.c (make_ssa_name): Don't ignore empty statements.
	(body_is_empty): Fix comment.


Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-cfg.c,v
retrieving revision 1.1.4.79
diff -d -u -p -r1.1.4.79 tree-cfg.c
--- tree-cfg.c	1 May 2003 16:50:21 -0000	1.1.4.79
+++ tree-cfg.c	1 May 2003 19:39:47 -0000
@@ -106,6 +106,7 @@ static inline bool stmt_starts_bb_p	PARA
 static inline bool stmt_ends_bb_p	PARAMS ((tree));
 static void find_contained_blocks_and_edge_targets
   PARAMS ((tree *, bitmap, bitmap, tree **));
+static void compute_reachable_eh	(tree stmt);
 
 /* Flowgraph optimization and cleanup.  */
 static void remove_unreachable_blocks	PARAMS ((void));
@@ -205,10 +206,7 @@ build_tree_cfg (fnbody)
 
   VARRAY_TREE_INIT (eh_stack, 10, "Exception Handlers");
 
-  /* Find the basic blocks for the flowgraph.  First skip any
-     non-executable statements at the start of the function.  Otherwise
-     we'll end up with an empty basic block 0, which is useless.  */
-
+  /* Find the basic blocks for the flowgraph.  Ignore empty functions.  */
   if (IS_EMPTY_STMT (fnbody) || TREE_CODE (fnbody) != BIND_EXPR)
     {
       timevar_pop (TV_TREE_CFG);
@@ -294,10 +292,6 @@ make_blocks (first_p, next_block_link, p
       tree prev_stmt;
       tree *stmt_p = tsi_container (i);
 
-      /* Ignore empty containers.  */
-      if (IS_EMPTY_STMT (*stmt_p) || *stmt_p == error_mark_node)
-	continue;
-
       prev_stmt = stmt;
       stmt = tsi_stmt (i);
 
@@ -310,16 +304,6 @@ make_blocks (first_p, next_block_link, p
 	  start_new_block = false;
 	}
 
-      /* Set the block for the container of non-executable statements.  */
-      if (stmt == NULL_TREE)
-	{
-	  if (bb)
-	    append_stmt_to_bb (stmt_p, bb, parent_stmt);
-	  last = *stmt_p;
-	  continue;
-	}
-
-      STRIP_NOPS (stmt);
       NEXT_BLOCK_LINK (stmt) = NULL_TREE;
       code = TREE_CODE (stmt);
 
@@ -402,110 +386,11 @@ make_blocks (first_p, next_block_link, p
 	  start_new_block = true;
 
 	  /* Right now we only model exceptions which occur via calls.
-	     This will need to be generalized in the future.  */
+	    This will need to be generalized in the future.  */
 	  if (TREE_CODE (stmt) == CALL_EXPR
 	      || (TREE_CODE (stmt) == MODIFY_EXPR
 		  && TREE_CODE (TREE_OPERAND (stmt, 1)) == CALL_EXPR))
-	    {
-	      int i;
-	      tree reachable_handlers = NULL_TREE;
-	      tree types_caught = NULL_TREE;
-	      int skip_cleanups = 0;
-
-	      /* EH_STACK contains all the exception handlers which enclose
-	         this statement.
-		 
-		 We want to examine the handlers innermost to outermost
-		 and determine which ones are actually reachable from this
-		 statement.  Those which are reachable are chained together
-		 on a list and added to the statement's annotation.  */
-	      for (i = VARRAY_ACTIVE_SIZE (eh_stack) - 1; i >= 0; i--)
-	        {
-		  tree handler = VARRAY_TREE (eh_stack, i);
-		  tree tp_node;
-
-		  if (TREE_CODE (handler) == CATCH_EXPR)
-		    {
-		      tree types = CATCH_TYPES (handler);
-
-		      /* This is a try/catch construct.  If it has no
-		         CATCH_TYPES, then it catches all types and we
-			 can stop our search early.  */
-		      if (types == NULL_TREE)
-			{
-			  reachable_handlers = tree_cons (void_type_node,
-						VARRAY_TREE (eh_stack, i),
-						reachable_handlers);
-			  break;
-			}
-
-		      /* If TYPES is not a list, make it a list to
-		         simplify handling below.  */
-		      if (TREE_CODE (types) != TREE_LIST)
-			types = tree_cons (NULL_TREE, types, NULL_TREE);
-
-		      /* See if the CATCH_TYPES specifies any types that have
-		         not already been handled.  If so, add those types to
-			 the types we handle and add this handler to the list
-			 of reachable handlers.  */
-		      for (tp_node = types;
-			   tp_node;
-			   tp_node = TREE_CHAIN (tp_node))
-		        {
-			  tree type = TREE_VALUE (tp_node);
-
-			  if (! check_handled (types_caught, type))
-			    {
-			      types_caught = tree_cons (NULL,
-					      		type,
-							types_caught);
-			      reachable_handlers
-				= tree_cons (void_type_node,
-					     VARRAY_TREE (eh_stack, i),
-					     reachable_handlers);
-			    }
-		        }
-
-		      skip_cleanups = 0;
-		    }
-		  else if (TREE_CODE (handler) == EH_FILTER_EXPR)
-		    {
-		      /* This is an exception specification.  If it has
-		         no types, then it ends our search.  */
-		      if (EH_FILTER_TYPES (handler) == NULL_TREE)
-			{
-			  reachable_handlers = tree_cons (void_type_node,
-						VARRAY_TREE (eh_stack, i),
-						reachable_handlers);
-			  break;
-			}
-
-		      /* This can throw a new exception, so it does not
-		         stop our search.  We should probably track the
-			 types it can throw.  */
-		      reachable_handlers = tree_cons (void_type_node,
-					    VARRAY_TREE (eh_stack, i),
-					    reachable_handlers);
-
-		      skip_cleanups = 0;
-		    }
-		  else if (!skip_cleanups)
-		    {
-		      /* This is a cleanup and is reachable.  It does not
-		         stop our search; however, we can skip other
-			 cleanups until we run into something else.  */
-		      reachable_handlers = tree_cons (void_type_node,
-					    VARRAY_TREE (eh_stack, i),
-					    reachable_handlers);
-		      skip_cleanups = 1;
-		    }
-	        }
-
-	      /* REACHABLE_HANDLERS now contains a list of all the reachable
-	         handlers.  */
-	      stmt_ann (stmt)->reachable_exception_handlers
-		= reachable_handlers;
-	    }
+	    compute_reachable_eh (stmt);
 	}
 
       last = stmt;
@@ -807,7 +692,7 @@ set_parent_stmt (stmt_p, parent_stmt)
       ann->parent_stmt = parent_stmt;
       t = (TREE_CODE (t) == COMPOUND_EXPR) ? TREE_OPERAND (t, 0) : NULL_TREE;
     }
-  while (t && ! IS_EMPTY_STMT (t));
+  while (t);
 }
 
 
@@ -825,7 +710,7 @@ add_stmt_to_bb (stmt_p, bb, parent)
   set_bb_for_stmt (*stmt_p, bb);
 
   /* Try to determine the parent if there isn't one.  */
-  if (parent == NULL && bb->head_tree_p != NULL)
+  if (parent == NULL_TREE && bb->head_tree_p != NULL)
     parent = parent_stmt (*bb->head_tree_p);
 
   set_parent_stmt (stmt_p, parent);
@@ -1746,21 +1631,19 @@ bsi_remove (i)
 {
   tree t = *(i->tp);
 
-  STRIP_NOPS (t);
-
-  if (!is_exec_stmt (t))
-    return;
-
-  if (TREE_CODE (t) == COMPOUND_EXPR)
+  if (is_exec_stmt (t))
     {
-      remove_stmt (&TREE_OPERAND (t, 0));
+      if (TREE_CODE (t) == COMPOUND_EXPR)
+	{
+	  remove_stmt (&TREE_OPERAND (t, 0));
 
-      /* If both operands are empty, delete the whole COMPOUND_EXPR.  */
-      if (IS_EMPTY_STMT (TREE_OPERAND (t, 1)))
+	  /* If both operands are empty, delete the whole COMPOUND_EXPR.  */
+	  if (IS_EMPTY_STMT (TREE_OPERAND (t, 1)))
+	    remove_stmt (i->tp);
+	}
+      else
 	remove_stmt (i->tp);
     }
-  else
-    remove_stmt (i->tp);
 
   bsi_next (i);
 }
@@ -1781,20 +1664,16 @@ remove_stmt (stmt_p)
   size_t i;
   tree *def_p;
   tree stmt = *stmt_p;
-
-  STRIP_NOPS (stmt);
+  basic_block bb = bb_for_stmt (stmt);
+  tree parent = parent_stmt (stmt);
 
   /* If the statement is a control structure, clear the appropriate BB_*
      flags from the basic block.  */
-  if (is_ctrl_stmt (stmt))
+  if (bb && is_ctrl_stmt (stmt))
     {
-      basic_block bb = bb_for_stmt (stmt);
-      if (bb)
-	{
-	  bb->flags &= ~BB_CONTROL_EXPR;
-	  if (TREE_CODE (stmt) == LOOP_EXPR)
-	    bb->flags &= ~BB_LOOP_CONTROL_EXPR;
-	}
+      bb->flags &= ~BB_CONTROL_EXPR;
+      if (TREE_CODE (stmt) == LOOP_EXPR)
+	bb->flags &= ~BB_LOOP_CONTROL_EXPR;
     }
 
   /* If the statement is a LABEL_EXPR, remove the LABEL_DECL from
@@ -1838,6 +1717,8 @@ remove_stmt (stmt_p)
 
   /* Replace STMT with an empty statement.  */
   *stmt_p = build_empty_stmt ();
+  if (bb)
+    add_stmt_to_bb (stmt_p, bb, parent);
 }
 
 
@@ -2547,10 +2428,7 @@ successor_block (bb)
   /* Special case.  If the block ends in a BIND_EXPR node, the successor
      block will be inside the BIND_EXPR's body.  */
   if (last_stmt && TREE_CODE (last_stmt) == BIND_EXPR)
-    {
-      STRIP_NOPS (last_stmt);
-      i = tsi_start (&BIND_EXPR_BODY (last_stmt));
-    }
+    i = tsi_start (&BIND_EXPR_BODY (last_stmt));
   else
     tsi_next (&i);
 
@@ -2795,8 +2673,6 @@ first_exec_stmt (entry_p)
       if (!stmt)
         continue;
 
-      STRIP_NOPS (stmt);
-
       /* Note that we actually return the container for the executable
 	 statement, not the statement itself.  This is to allow the caller to
 	 start iterating from this point.  */
@@ -2817,7 +2693,7 @@ first_exec_block (entry_p)
 {
   tree *exec_p;
 
-  if (entry_p == NULL || IS_EMPTY_STMT (*entry_p))
+  if (entry_p == NULL)
     return NULL;
 
   exec_p = first_exec_stmt (entry_p);
@@ -2849,19 +2725,9 @@ first_stmt (bb)
      basic_block bb;
 {
   block_stmt_iterator i;
-  tree t;
-
-  if (bb == NULL || bb->index < 0)
-    return NULL_TREE;
 
   i = bsi_start (bb);
-
-  /* Check for blocks with no remaining statements.  */
-  if (bsi_end_p (i))
-    t = NULL_TREE;
-  else
-    t = bsi_stmt (i);
-  return t;
+  return (!bsi_end_p (i)) ? bsi_stmt (i) : NULL_TREE;
 }
 
 
@@ -2971,18 +2837,25 @@ bsi_next_in_bb (i, bb)
   tree t, stmt = NULL_TREE;
   block_stmt_iterator bind;
 
+  /* Go to the next statement skipping over empty statements we may find.  */
   do
     {
       t = *(i->tp);
-      STRIP_NOPS (t);
       if (TREE_CODE (t) == COMPOUND_EXPR)
 	i->tp = &(TREE_OPERAND (t, 1));
       else
-	i->tp = NULL;
+	{
+	  /* We ran out of statements.  Clear the iterator and stop
+	     searching.  */
+	  i->tp = NULL;
+	  break;
+	}
+
+      stmt = bsi_stmt (*i);
     }
-  while (i->tp && (stmt = bsi_stmt (*i)) == NULL_TREE);
+  while (IS_EMPTY_STMT (stmt));
 
-  if (i->tp && bb_for_stmt (*(i->tp)) != bb) 
+  if (i->tp && bb_for_stmt (stmt) != bb) 
     i->tp = NULL;
 
   if (i->tp && TREE_CODE (stmt) == BIND_EXPR)
@@ -3015,15 +2888,6 @@ bsi_next_in_bb (i, bb)
          traverse to the next statement.  */
       i->tp = (tree *)TREE_VALUE (i->context);
       i->context = TREE_PURPOSE (i->context);
-
-      /* FIXME.  Hack to recover BB for cases when we are stepping out of a
-	 removed statement.  If bsi_remove() has been called on the
-	 last statement of a BIND_EXPR body, the next call to
-	 bsi_next() will retrieve a NULL basic block from the just deleted
-	 statement, so that BB will be NULL.  We restore BB using the
-	 BIND_EXPR node itself.  */
-      bb = bb_for_stmt (*(i->tp));
-
       bsi_next_in_bb (i, bb);
     }
 }
@@ -3173,6 +3037,7 @@ bsi_update_from_tsi (bsi, tsi)
   bsi->tp = tsi.tp;
 }
 
+
 /* Insert statement T into basic block BB.  */
 
 void
@@ -3182,9 +3047,6 @@ set_bb_for_stmt (t, bb)
 {
   stmt_ann_t ann;
 
-  if (IS_EMPTY_STMT (t))
-    return;
-
   do
     {
       /* If the statement is a label, add the label to block-to-labels map
@@ -3200,7 +3062,7 @@ set_bb_for_stmt (t, bb)
       ann->bb = bb;
       t = (TREE_CODE (t) == COMPOUND_EXPR) ? TREE_OPERAND (t, 0) : NULL_TREE;
     }
-  while (t && !IS_EMPTY_STMT (t));
+  while (t);
 }
 
 
@@ -3904,7 +3766,112 @@ remap_stmts (basic_block bb1, basic_bloc
   return false;
 }
 
-/* Tree specific functions for the cfg loop optimizer.  */
+
+/* Compute reachable exception handlers for STMT, which is assumed to be
+   a function call and the last statement of its basic block.  */
+
+static void
+compute_reachable_eh (tree stmt)
+{
+  int i;
+  tree reachable_handlers = NULL_TREE;
+  tree types_caught = NULL_TREE;
+  int skip_cleanups = 0;
+
+  /* EH_STACK contains all the exception handlers which enclose
+     this statement.
+
+     We want to examine the handlers innermost to outermost
+     and determine which ones are actually reachable from this
+     statement.  Those which are reachable are chained together
+     on a list and added to the statement's annotation.  */
+  for (i = VARRAY_ACTIVE_SIZE (eh_stack) - 1; i >= 0; i--)
+    {
+      tree handler = VARRAY_TREE (eh_stack, i);
+      tree tp_node;
+
+      if (TREE_CODE (handler) == CATCH_EXPR)
+	{
+	  tree types = CATCH_TYPES (handler);
+
+	  /* This is a try/catch construct.  If it has no
+	     CATCH_TYPES, then it catches all types and we
+	     can stop our search early.  */
+	  if (types == NULL_TREE)
+	    {
+	      reachable_handlers = tree_cons (void_type_node,
+					      VARRAY_TREE (eh_stack, i),
+					      reachable_handlers);
+	      break;
+	    }
+
+	  /* If TYPES is not a list, make it a list to
+	     simplify handling below.  */
+	  if (TREE_CODE (types) != TREE_LIST)
+	    types = tree_cons (NULL_TREE, types, NULL_TREE);
+
+	  /* See if the CATCH_TYPES specifies any types that have
+	     not already been handled.  If so, add those types to
+	     the types we handle and add this handler to the list
+	     of reachable handlers.  */
+	  for (tp_node = types; tp_node; tp_node = TREE_CHAIN (tp_node))
+	    {
+	      tree type = TREE_VALUE (tp_node);
+
+	      if (!check_handled (types_caught, type))
+		{
+		  types_caught = tree_cons (NULL, type, types_caught);
+		  reachable_handlers
+		    = tree_cons (void_type_node,
+				 VARRAY_TREE (eh_stack, i),
+				 reachable_handlers);
+		}
+	    }
+
+	  skip_cleanups = 0;
+	}
+      else if (TREE_CODE (handler) == EH_FILTER_EXPR)
+	{
+	  /* This is an exception specification.  If it has
+	     no types, then it ends our search.  */
+	  if (EH_FILTER_TYPES (handler) == NULL_TREE)
+	    {
+	      reachable_handlers = tree_cons (void_type_node,
+					      VARRAY_TREE (eh_stack, i),
+					      reachable_handlers);
+	      break;
+	    }
+
+	  /* This can throw a new exception, so it does not
+	     stop our search.  We should probably track the
+	     types it can throw.  */
+	  reachable_handlers = tree_cons (void_type_node,
+					  VARRAY_TREE (eh_stack, i),
+					  reachable_handlers);
+
+	  skip_cleanups = 0;
+	}
+      else if (!skip_cleanups)
+	{
+	  /* This is a cleanup and is reachable.  It does not
+	     stop our search; however, we can skip other
+	     cleanups until we run into something else.  */
+	  reachable_handlers = tree_cons (void_type_node,
+					  VARRAY_TREE (eh_stack, i),
+					  reachable_handlers);
+	  skip_cleanups = 1;
+	}
+    }
+
+  /* REACHABLE_HANDLERS now contains a list of all the reachable
+     handlers.  */
+  stmt_ann (stmt)->reachable_exception_handlers = reachable_handlers;
+}
+
+
+/*---------------------------------------------------------------------------
+	    Tree specific functions for the cfg loop optimizer
+---------------------------------------------------------------------------*/
 
 /* Split a (typically critical) edge.  Return the new block.
    Abort on abnormal edges.  */
@@ -3927,11 +3894,10 @@ tree_split_edge (edge_in)
   return new_bb;
 }
 
+
 /* Verifies that the flow information is ok.  */
 
 void 
 tree_verify_flow_info ()
 {
-  
 }
-
Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-dfa.c,v
retrieving revision 1.1.4.104
diff -d -u -p -r1.1.4.104 tree-dfa.c
--- tree-dfa.c	1 May 2003 16:50:21 -0000	1.1.4.104
+++ tree-dfa.c	1 May 2003 19:39:47 -0000
@@ -200,8 +200,6 @@ get_stmt_operands (stmt)
   if (stmt == error_mark_node || IS_EMPTY_STMT (stmt))
     return;
 
-  STRIP_NOPS (stmt);
-
   /* If the statement has not been modified, the operands are still valid.  */
   if (!stmt_modified_p (stmt))
     return;
@@ -1026,27 +1024,6 @@ remove_phi_node (phi, prev, bb)
 
 
 /*---------------------------------------------------------------------------
-			     Code replacement
----------------------------------------------------------------------------*/
-/* Return a copy of statement ORIG.  Note that the original statement
-   annotations are not copied.  */
-
-tree
-copy_stmt (orig)
-     tree orig;
-{
-  tree copy;
-
-  STRIP_NOPS (orig);
-  copy = orig;
-  walk_tree (&copy, copy_tree_r, NULL, NULL);
-  copy->common.ann = NULL;
-
-  return copy;
-}
-
-
-/*---------------------------------------------------------------------------
 			Dataflow analysis (DFA) routines
 ---------------------------------------------------------------------------*/
 /* Compute immediate uses.  */
@@ -1209,7 +1186,6 @@ create_stmt_ann (t)
 
 #if defined ENABLE_CHECKING
   if (t == NULL_TREE
-      || IS_EMPTY_STMT (t)
       || TREE_CODE_CLASS (TREE_CODE (t)) == 'c'
       || TREE_CODE_CLASS (TREE_CODE (t)) == 't')
     abort ();
@@ -1223,7 +1199,6 @@ create_stmt_ann (t)
   /* Since we just created the annotation, mark the statement modified.  */
   ann->modified = true;
 
-  STRIP_NOPS (t);
   t->common.ann = (tree_ann) ann;
   ann->common.stmt = t; 
 
Index: tree-flow-inline.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-flow-inline.h,v
retrieving revision 1.1.2.35
diff -d -u -p -r1.1.2.35 tree-flow-inline.h
--- tree-flow-inline.h	1 May 2003 16:50:21 -0000	1.1.2.35
+++ tree-flow-inline.h	1 May 2003 19:39:47 -0000
@@ -396,18 +396,13 @@ static inline tree *
 bsi_stmt_ptr (i)
      block_stmt_iterator i;
 {
-  tree t;
-
 #if defined ENABLE_CHECKING
   if (i.tp == NULL || *i.tp == NULL_TREE)
     abort ();
 #endif
 
-  t = *(i.tp);
-  STRIP_NOPS (t);
-
-  if (TREE_CODE (t) == COMPOUND_EXPR)
-    return &TREE_OPERAND (t, 0);
+  if (TREE_CODE ((*i.tp)) == COMPOUND_EXPR)
+    return &TREE_OPERAND ((*i.tp), 0);
   else
     return i.tp;
 }
@@ -416,11 +411,7 @@ static inline tree
 bsi_stmt (i)
      block_stmt_iterator i;
 {
-  tree t = *(bsi_stmt_ptr (i));
-  STRIP_NOPS (t);
-  if (IS_EMPTY_STMT (t) || t == error_mark_node)
-    t = NULL_TREE;
-  return t;
+  return *(bsi_stmt_ptr (i));
 }
 
 static inline tree *
Index: tree-flow.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-flow.h,v
retrieving revision 1.1.4.73
diff -d -u -p -r1.1.4.73 tree-flow.h
--- tree-flow.h	24 Apr 2003 17:11:17 -0000	1.1.4.73
+++ tree-flow.h	1 May 2003 19:39:47 -0000
@@ -436,7 +436,6 @@ extern void compute_may_aliases		PARAMS 
 extern void compute_reached_uses	PARAMS ((int));
 extern void compute_immediate_uses	PARAMS ((int));
 extern void compute_reaching_defs	PARAMS ((int));
-extern tree copy_stmt			PARAMS ((tree));
 extern void dump_alias_info		PARAMS ((FILE *));
 extern void debug_alias_info		PARAMS ((void));
 extern tree get_virtual_var		PARAMS ((tree));
Index: tree-iterator.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-iterator.h,v
retrieving revision 1.1.2.3
diff -d -u -p -r1.1.2.3 tree-iterator.h
--- tree-iterator.h	1 May 2003 16:50:21 -0000	1.1.2.3
+++ tree-iterator.h	1 May 2003 19:39:47 -0000
@@ -74,7 +74,6 @@ tsi_next (i)
      tree_stmt_iterator *i;
 {
   tree t = *(i->tp);
-  STRIP_NOPS (t);
   if (TREE_CODE (t) == COMPOUND_EXPR)
     i->tp = &(TREE_OPERAND (t, 1));
   else
@@ -101,7 +100,6 @@ tsi_stmt_ptr (i)
 #endif
 
   t = *(i.tp);
-  STRIP_NOPS (t);
 
   if (TREE_CODE (t) == COMPOUND_EXPR)
     return &TREE_OPERAND (t, 0);
@@ -114,8 +112,7 @@ tsi_stmt (i)
      tree_stmt_iterator i;
 {
   tree t = *(tsi_stmt_ptr (i));
-  STRIP_NOPS (t);
-  if (IS_EMPTY_STMT (t) || t == error_mark_node)
+  if (t == error_mark_node)
     t = NULL_TREE;
   return t;
 }
Index: tree-pretty-print.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-pretty-print.c,v
retrieving revision 1.1.2.23
diff -d -u -p -r1.1.2.23 tree-pretty-print.c
--- tree-pretty-print.c	1 May 2003 16:50:21 -0000	1.1.2.23
+++ tree-pretty-print.c	1 May 2003 19:39:47 -0000
@@ -155,7 +155,7 @@ dump_generic_node (buffer, node, spc, fl
   if (node == NULL_TREE)
     return spc;
 
-  if (!IS_EMPTY_STMT (node) && node != error_mark_node)
+  if (node != error_mark_node)
     {
       basic_block curr_bb = bb_for_stmt (node);
 
Index: tree-ssa-ccp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-ccp.c,v
retrieving revision 1.1.2.67
diff -d -u -p -r1.1.2.67 tree-ssa-ccp.c
--- tree-ssa-ccp.c	5 Apr 2003 15:19:41 -0000	1.1.2.67
+++ tree-ssa-ccp.c	1 May 2003 19:39:48 -0000
@@ -1197,7 +1197,6 @@ fold_stmt (stmt)
 {
   tree rhs, result;
 
-  STRIP_NOPS (stmt);
   rhs = get_rhs (stmt);
   if (rhs)
     {
Index: tree-ssa-dce.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-dce.c,v
retrieving revision 1.1.2.34
diff -d -u -p -r1.1.2.34 tree-ssa-dce.c
--- tree-ssa-dce.c	1 May 2003 16:50:21 -0000	1.1.2.34
+++ tree-ssa-dce.c	1 May 2003 19:39:48 -0000
@@ -252,7 +252,6 @@ find_useful_stmts ()
       for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
 	{
 	  tree stmt = bsi_stmt (i);
-	  STRIP_NOPS (stmt);
 
 	  if (stmt_useful_p (stmt))
 	    mark_necessary (stmt);
@@ -481,7 +480,6 @@ remove_dead_stmt (i, bb)
   tree t;
 
   t = bsi_stmt (*i);
-  STRIP_NOPS (t);
 
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.72
diff -d -u -p -r1.1.4.72 tree-ssa.c
--- tree-ssa.c	1 May 2003 16:50:21 -0000	1.1.4.72
+++ tree-ssa.c	1 May 2003 19:39:48 -0000
@@ -518,8 +518,6 @@ mark_def_sites (idom, globals)
 	  tree *dest;
 
 	  stmt = bsi_stmt (si);
-	  STRIP_NOPS (stmt);
-
 	  get_stmt_operands (stmt);
 
 	  /* If a variable is used before being set, then the variable
@@ -1462,7 +1460,6 @@ rewrite_out_of_ssa (fndecl)
 	  tree *use_p = NULL;
 	  int remove = 0, is_copy = 0;
 
-	  STRIP_NOPS (stmt);
 	  get_stmt_operands (stmt);
 
 	  if (TREE_CODE (stmt) == MODIFY_EXPR 
@@ -1886,7 +1883,6 @@ rewrite_stmt (si, block_defs_p, block_av
   bool may_optimize_p;
 
   stmt = bsi_stmt (si);
-  STRIP_NOPS (stmt);
   ann = stmt_ann (stmt);
   ssa_stats.num_stmts++;
 
Index: tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.263.2.29
diff -d -u -p -r1.263.2.29 tree.c
--- tree.c	1 May 2003 16:50:21 -0000	1.263.2.29
+++ tree.c	1 May 2003 19:39:49 -0000
@@ -4941,8 +4941,7 @@ make_ssa_name (var, stmt)
       || (!IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (stmt)))
 	  && TREE_CODE (stmt) != ASM_EXPR
 	  && TREE_CODE (stmt) != RETURN_EXPR
-	  && TREE_CODE (stmt) != PHI_NODE
-	  && !IS_EMPTY_STMT (stmt)))
+	  && TREE_CODE (stmt) != PHI_NODE))
     abort ();
 #endif
 
@@ -5109,7 +5108,7 @@ tsi_stmt_list_head (anchor)
   return i;
 }
 
-/* Return true if the chain of statements starting with T.  */
+/* Return true if the chain of statements starting with T is empty.  */
 
 bool
 body_is_empty (t)



More information about the Gcc-patches mailing list