/* Dead code elimination pass for the GNU compiler.
- Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+ 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.
GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
+Free Software Foundation; either version 3, or (at your option) any
later version.
GCC is distributed in the hope that it will be useful, but WITHOUT
for more details.
You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
/* Dead code elimination.
can then remove the block and labels. */
switch (TREE_CODE (stmt))
{
- case BIND_EXPR:
+ case PREDICT_EXPR:
case LABEL_EXPR:
case CASE_LABEL_EXPR:
mark_stmt_necessary (stmt, false);
case ASM_EXPR:
case RESX_EXPR:
case RETURN_EXPR:
+ case CHANGE_DYNAMIC_TYPE_EXPR:
mark_stmt_necessary (stmt, true);
return;
basic_block post_dom_bb;
/* The post dominance info has to be up-to-date. */
- gcc_assert (dom_computed[CDI_POST_DOMINATORS] == DOM_OK);
+ gcc_assert (dom_info_state (CDI_POST_DOMINATORS) == DOM_OK);
/* Get the immediate post dominator of bb. */
post_dom_bb = get_immediate_dominator (CDI_POST_DOMINATORS, bb);
== SSA_NAME)
&& !TEST_BIT (processed, SSA_NAME_VERSION (name)))
{
+ tree oldlhs = GIMPLE_STMT_OPERAND (t, 0);
something_changed = true;
if (dump_file && (dump_flags & TDF_DETAILS))
{
maybe_clean_or_replace_eh_stmt (t, call);
mark_symbols_for_renaming (call);
pop_stmt_changes (bsi_stmt_ptr (i));
+ release_ssa_name (oldlhs);
}
notice_special_calls (call);
}
return flag_tree_dce != 0;
}
-struct tree_opt_pass pass_dce =
+struct gimple_opt_pass pass_dce =
{
+ {
+ GIMPLE_PASS,
"dce", /* name */
gate_dce, /* gate */
tree_ssa_dce, /* execute */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_dump_func | TODO_verify_ssa, /* todo_flags_finish */
- 0 /* letter */
+ TODO_dump_func | TODO_verify_ssa /* todo_flags_finish */
+ }
};
-struct tree_opt_pass pass_dce_loop =
+struct gimple_opt_pass pass_dce_loop =
{
+ {
+ GIMPLE_PASS,
"dceloop", /* name */
gate_dce, /* gate */
tree_ssa_dce_loop, /* execute */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_dump_func | TODO_verify_ssa, /* todo_flags_finish */
- 0 /* letter */
+ TODO_dump_func | TODO_verify_ssa /* todo_flags_finish */
+ }
};
-struct tree_opt_pass pass_cd_dce =
+struct gimple_opt_pass pass_cd_dce =
{
+ {
+ GIMPLE_PASS,
"cddce", /* name */
gate_dce, /* gate */
tree_ssa_cd_dce, /* execute */
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_dump_func | TODO_verify_ssa
- | TODO_verify_flow, /* todo_flags_finish */
- 0 /* letter */
+ | TODO_verify_flow /* todo_flags_finish */
+ }
};