mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-24 05:29:10 +08:00
tree-ssa-live.c (remove_unused_locals): Mark all edge's goto_block as used.
* tree-ssa-live.c (remove_unused_locals): Mark all edge's goto_block as used. * gimple-low.c (lower_function_body, lower_gimple_return, lower_builtin_setjmp): Set gimple_block on the newly created stmts. * tree-cfg.c (make_cond_expr_edges, make_goto_expr_edges): Only set goto_block on edges if goto_locus is known. From-SVN: r141002
This commit is contained in:
parent
a3d3c0f5fa
commit
cc2a64dd80
@ -1,3 +1,12 @@
|
||||
2008-10-09 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* tree-ssa-live.c (remove_unused_locals): Mark all edge's goto_block
|
||||
as used.
|
||||
* gimple-low.c (lower_function_body, lower_gimple_return,
|
||||
lower_builtin_setjmp): Set gimple_block on the newly created stmts.
|
||||
* tree-cfg.c (make_cond_expr_edges, make_goto_expr_edges): Only set
|
||||
goto_block on edges if goto_locus is known.
|
||||
|
||||
2008-10-08 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* graphite.c (gloog): Don't call find_unreachable_blocks
|
||||
|
@ -133,6 +133,7 @@ lower_function_body (void)
|
||||
{
|
||||
x = gimple_build_return (NULL);
|
||||
gimple_set_location (x, cfun->function_end_locus);
|
||||
gimple_set_block (x, DECL_INITIAL (current_function_decl));
|
||||
gsi_insert_after (&i, x, GSI_CONTINUE_LINKING);
|
||||
}
|
||||
|
||||
@ -659,6 +660,7 @@ lower_gimple_return (gimple_stmt_iterator *gsi, struct lower_data *data)
|
||||
found:
|
||||
t = gimple_build_goto (tmp_rs.label);
|
||||
gimple_set_location (t, gimple_location (stmt));
|
||||
gimple_set_block (t, gimple_block (stmt));
|
||||
gsi_insert_before (gsi, t, GSI_SAME_STMT);
|
||||
gsi_remove (gsi, false);
|
||||
}
|
||||
@ -736,6 +738,7 @@ lower_builtin_setjmp (gimple_stmt_iterator *gsi)
|
||||
t = implicit_built_in_decls[BUILT_IN_SETJMP_SETUP];
|
||||
g = gimple_build_call (t, 2, gimple_call_arg (stmt, 0), arg);
|
||||
gimple_set_location (g, gimple_location (stmt));
|
||||
gimple_set_block (g, gimple_block (stmt));
|
||||
gsi_insert_before (gsi, g, GSI_SAME_STMT);
|
||||
|
||||
/* Build 'DEST = 0' and insert. */
|
||||
@ -744,6 +747,7 @@ lower_builtin_setjmp (gimple_stmt_iterator *gsi)
|
||||
g = gimple_build_assign (dest, fold_convert (TREE_TYPE (dest),
|
||||
integer_zero_node));
|
||||
gimple_set_location (g, gimple_location (stmt));
|
||||
gimple_set_block (g, gimple_block (stmt));
|
||||
gsi_insert_before (gsi, g, GSI_SAME_STMT);
|
||||
}
|
||||
|
||||
@ -760,6 +764,7 @@ lower_builtin_setjmp (gimple_stmt_iterator *gsi)
|
||||
t = implicit_built_in_decls[BUILT_IN_SETJMP_RECEIVER];
|
||||
g = gimple_build_call (t, 1, arg);
|
||||
gimple_set_location (g, gimple_location (stmt));
|
||||
gimple_set_block (g, gimple_block (stmt));
|
||||
gsi_insert_before (gsi, g, GSI_SAME_STMT);
|
||||
|
||||
/* Build 'DEST = 1' and insert. */
|
||||
@ -768,6 +773,7 @@ lower_builtin_setjmp (gimple_stmt_iterator *gsi)
|
||||
g = gimple_build_assign (dest, fold_convert (TREE_TYPE (dest),
|
||||
integer_one_node));
|
||||
gimple_set_location (g, gimple_location (stmt));
|
||||
gimple_set_block (g, gimple_block (stmt));
|
||||
gsi_insert_before (gsi, g, GSI_SAME_STMT);
|
||||
}
|
||||
|
||||
|
@ -658,11 +658,13 @@ make_cond_expr_edges (basic_block bb)
|
||||
|
||||
e = make_edge (bb, then_bb, EDGE_TRUE_VALUE);
|
||||
e->goto_locus = gimple_location (then_stmt);
|
||||
if (e->goto_locus)
|
||||
e->goto_block = gimple_block (then_stmt);
|
||||
e = make_edge (bb, else_bb, EDGE_FALSE_VALUE);
|
||||
if (e)
|
||||
{
|
||||
e->goto_locus = gimple_location (else_stmt);
|
||||
if (e->goto_locus)
|
||||
e->goto_block = gimple_block (else_stmt);
|
||||
}
|
||||
|
||||
@ -853,6 +855,7 @@ make_goto_expr_edges (basic_block bb)
|
||||
tree dest = gimple_goto_dest (goto_t);
|
||||
edge e = make_edge (bb, label_to_block (dest), EDGE_FALLTHRU);
|
||||
e->goto_locus = gimple_location (goto_t);
|
||||
if (e->goto_locus)
|
||||
e->goto_block = gimple_block (goto_t);
|
||||
gsi_remove (&last, true);
|
||||
return;
|
||||
|
@ -600,6 +600,8 @@ remove_unused_locals (void)
|
||||
{
|
||||
gimple_stmt_iterator gsi;
|
||||
size_t i;
|
||||
edge_iterator ei;
|
||||
edge e;
|
||||
|
||||
/* Walk the statements. */
|
||||
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
|
||||
@ -634,6 +636,10 @@ remove_unused_locals (void)
|
||||
mark_all_vars_used (&arg, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
FOR_EACH_EDGE (e, ei, bb->succs)
|
||||
if (e->goto_locus)
|
||||
TREE_USED (e->goto_block) = true;
|
||||
}
|
||||
|
||||
/* Remove unmarked local vars from local_decls. */
|
||||
|
Loading…
Reference in New Issue
Block a user