OSDN Git Service

* gdbinit.in: Set complaints to 0.
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-dce.c
index 15c2ee4..3b20562 100644 (file)
@@ -1,5 +1,5 @@
 /* Dead code elimination pass for the GNU compiler.
-   Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
    Contributed by Ben Elliston <bje@redhat.com>
    and Andrew MacLeod <amacleod@redhat.com>
    Adapted to use control dependence by Steven Bosscher, SUSE Labs.
@@ -105,17 +105,12 @@ static sbitmap visited_control_parents;
    to be recomputed.  */
 static bool cfg_altered;
 
-/* Execute CODE for each edge (given number EDGE_NUMBER within the CODE)
-   for which the block with index N is control dependent.  */
-#define EXECUTE_IF_CONTROL_DEPENDENT(N, EDGE_NUMBER, CODE)                   \
-  {                                                                          \
-    bitmap_iterator bi;                                                              \
-                                                                             \
-    EXECUTE_IF_SET_IN_BITMAP (control_dependence_map[N], 0, EDGE_NUMBER, bi)  \
-      {                                                                              \
-       CODE;                                                                 \
-      }                                                                              \
-  }
+/* Execute code that follows the macro for each edge (given number
+   EDGE_NUMBER within the CODE) for which the block with index N is
+   control dependent.  */
+#define EXECUTE_IF_CONTROL_DEPENDENT(BI, N, EDGE_NUMBER)       \
+  EXECUTE_IF_SET_IN_BITMAP (control_dependence_map[(N)], 0,    \
+                           (EDGE_NUMBER), (BI))
 
 /* Local function prototypes.  */
 static inline void set_control_dependence_map_bit (basic_block, int);
@@ -152,8 +147,8 @@ set_control_dependence_map_bit (basic_block bb, int edge_index)
 }
 
 /* Clear all control dependences for block BB.  */
-static inline
-void clear_control_dependence_bitmap (basic_block bb)
+static inline void
+clear_control_dependence_bitmap (basic_block bb)
 {
   bitmap_clear (control_dependence_map[bb->index]);
 }
@@ -221,7 +216,7 @@ find_pdom (basic_block block)
     }
 }
 \f
-#define NECESSARY(stmt)                stmt->common.asm_written_flag
+#define NECESSARY(stmt)                stmt->base.asm_written_flag
 
 /* If STMT is not already marked necessary, mark it, and add it to the
    worklist if ADD_TO_WORKLIST is true.  */
@@ -323,7 +318,7 @@ mark_stmt_if_obviously_necessary (tree stmt, bool aggressive)
        mark_stmt_necessary (stmt, true);
       return;
 
-    case MODIFY_EXPR:
+    case GIMPLE_MODIFY_STMT:
       op = get_call_expr_in (stmt);
       if (op && TREE_SIDE_EFFECTS (op))
        {
@@ -334,8 +329,8 @@ mark_stmt_if_obviously_necessary (tree stmt, bool aggressive)
       /* These values are mildly magic bits of the EH runtime.  We can't
         see the entire lifetime of these values until landing pads are
         generated.  */
-      if (TREE_CODE (TREE_OPERAND (stmt, 0)) == EXC_PTR_EXPR
-         || TREE_CODE (TREE_OPERAND (stmt, 0)) == FILTER_EXPR)
+      if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == EXC_PTR_EXPR
+         || TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == FILTER_EXPR)
        {
          mark_stmt_necessary (stmt, true);
          return;
@@ -443,6 +438,7 @@ find_obviously_necessary_stmts (struct edge_list *el)
 static void
 mark_control_dependent_edges_necessary (basic_block bb, struct edge_list *el)
 {
+  bitmap_iterator bi;
   unsigned edge_number;
 
   gcc_assert (bb != EXIT_BLOCK_PTR);
@@ -450,7 +446,7 @@ mark_control_dependent_edges_necessary (basic_block bb, struct edge_list *el)
   if (bb == ENTRY_BLOCK_PTR)
     return;
 
-  EXECUTE_IF_CONTROL_DEPENDENT (bb->index, edge_number,
+  EXECUTE_IF_CONTROL_DEPENDENT (bi, bb->index, edge_number)
     {
       tree t;
       basic_block cd_bb = INDEX_EDGE_PRED_BB (el, edge_number);
@@ -462,7 +458,7 @@ mark_control_dependent_edges_necessary (basic_block bb, struct edge_list *el)
       t = last_stmt (cd_bb);
       if (t && is_ctrl_stmt (t))
        mark_stmt_necessary (t, true);
-    });
+    }
 }
 \f
 /* Propagate necessity using the operands of necessary statements.  Process
@@ -724,7 +720,7 @@ remove_dead_stmt (block_stmt_iterator *i, basic_block bb)
      nothing to the program, then we not only remove it, but we also change
      the flow graph so that the current block will simply fall-thru to its
      immediate post-dominator.  The blocks we are circumventing will be
-     removed by cleaup_tree_cfg if this change in the flow graph makes them
+     removed by cleanup_tree_cfg if this change in the flow graph makes them
      unreachable.  */
   if (is_ctrl_stmt (t))
     {
@@ -937,7 +933,7 @@ static unsigned int
 tree_ssa_dce_loop (void)
 {
   perform_tree_ssa_dce (/*aggressive=*/false);
-  free_numbers_of_iterations_estimates (current_loops);
+  free_numbers_of_iterations_estimates ();
   scev_reset ();
   return 0;
 }