/* 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.
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);
}
/* 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]);
}
}
}
\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. */
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))
{
/* 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;
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);
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);
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
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))
{
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;
}