diff options
author | Richard Henderson <rth@redhat.com> | 2004-07-08 09:16:41 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-07-08 09:16:41 -0700 |
commit | cd7097527ee51b1bef879ef53505dff0673c98ba (patch) | |
tree | 200138df775b12823401ef7db79aecec6a2142da /gcc/tree-ssa-dce.c | |
parent | c618c6ec7e797b5aa69218b86cd643bb65c0c48a (diff) |
tree-cfg.c (make_exit_edges): Use get_call_expr_in.
* tree-cfg.c (make_exit_edges): Use get_call_expr_in.
(remove_useless_stmts_1, is_ctrl_altering_stmt): Likewise.
(tree_block_ends_with_call_p, need_fake_edge_p): Likewise.
* tree-eh.c (lower_eh_constructs_1): Likewise.
* tree-sra.c (sra_walk_modify_expr): Likewise.
* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise.
(eliminate_unnecessary_stmts): Likewise.
* tree-ssa-dse.c (dse_optimize_stmt): Likewise.
* tree-tailcall.c (optimize_tail_call): Likewise.
* tree-ssa-ccp.c (get_rhs, set_rhs): Reorg to use switch.
From-SVN: r84298
Diffstat (limited to 'gcc/tree-ssa-dce.c')
-rw-r--r-- | gcc/tree-ssa-dce.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c index e9ead5c0dfb..60287ce5c1c 100644 --- a/gcc/tree-ssa-dce.c +++ b/gcc/tree-ssa-dce.c @@ -290,6 +290,7 @@ mark_stmt_if_obviously_necessary (tree stmt, bool aggressive) v_must_def_optype v_must_defs; stmt_ann_t ann; size_t i; + tree op; /* Statements that are implicitly live. Most function calls, asm and return statements are required. Labels and BIND_EXPR nodes are kept because @@ -319,8 +320,8 @@ mark_stmt_if_obviously_necessary (tree stmt, bool aggressive) return; case MODIFY_EXPR: - if (TREE_CODE (TREE_OPERAND (stmt, 1)) == CALL_EXPR - && TREE_SIDE_EFFECTS (TREE_OPERAND (stmt, 1))) + op = get_call_expr_in (stmt); + if (op && TREE_SIDE_EFFECTS (op)) { mark_stmt_necessary (stmt, true); return; @@ -638,11 +639,9 @@ eliminate_unnecessary_stmts (void) remove_dead_stmt (&i, bb); else { - if (TREE_CODE (t) == CALL_EXPR) - notice_special_calls (t); - else if (TREE_CODE (t) == MODIFY_EXPR - && TREE_CODE (TREE_OPERAND (t, 1)) == CALL_EXPR) - notice_special_calls (TREE_OPERAND (t, 1)); + tree call = get_call_expr_in (t); + if (call) + notice_special_calls (call); bsi_next (&i); } } |