aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2006-09-29 06:32:58 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2006-09-29 06:32:58 +0000
commit4f6c213142e5ce6f5ee17ef5d0f1cb85cd0ff573 (patch)
treec8e2772aad71fdf66dba0112c42b9178748e598f /gcc/tree-inline.c
parenta40e443fe8ce40cabbedbe4d134a3e7d397ea089 (diff)
downloadgcc-4f6c213142e5ce6f5ee17ef5d0f1cb85cd0ff573.zip
gcc-4f6c213142e5ce6f5ee17ef5d0f1cb85cd0ff573.tar.gz
gcc-4f6c213142e5ce6f5ee17ef5d0f1cb85cd0ff573.tar.bz2
builtins.c (expand_builtin_setjmp): Delete.
* builtins.c (expand_builtin_setjmp): Delete. (expand_builtin) <BUILT_IN_SETJMP>: Mark as unreachable. <BUILT_IN_SETJMP_SETUP>: New case. <BUILT_IN_SETJMP_DISPATCHER>: Likewise. <BUILT_IN_SETJMP_RECEIVER>: Likewise. * builtins.def (BUILT_IN_SETJMP_SETUP): New built-in stub. (BUILT_IN_SETJMP_DISPATCHER): Likewise. (BUILT_IN_SETJMP_RECEIVER): Likewise. * gimple-low.c (struct lower_data): New field calls_builtin_setjmp. (lower_function_body): Initialize it to false. If it is set to true at the end of the processing, emit the setjmp dispatcher. (lower_stmt) <CALL_EXPR>: Invoke lower_builtin_setjmp if the callee is __builtin_setjmp and set calls_builtin_setjmp to true as well. <MODIFY_EXPR>: Fall through to above case if there is a CALL_EXPR on the rhs of the assignment. (lower_builtin_setjmp): New function. * tree.c (build_common_builtin_nodes): Build BUILT_IN_SETJMP_SETUP, BUILT_IN_SETJMP_DISPATCHER and BUILT_IN_SETJMP_RECEIVER nodes. * tree-cfg.c (make_exit_edges) <CALL_EXPR>: Use specific predicate to detect calls that can go to non-local labels. Use specific helper to create the abnormal edges associated with them. <MODIFY_EXPR>: Likewise. (make_abnormal_goto_edges): New function extracted from... (make_goto_expr_edges): ...here. Call it for computed gotos. (simple_goto_p): Minor tweak. (tree_can_make_abnormal_goto): New predicate. (tree_redirect_edge_and_branch): Return zero on all abnormal edges. (tree_purge_dead_abnormal_call_edges): New function. * tree-flow.h (tree_can_make_abnormal_goto): Declare. (tree_purge_dead_abnormal_call_edges): Likewise. (make_abnormal_goto_edges): Likewise. * tree-inline.c (expand_call_inline): Simplify statement frobbing. Purge all dead abnormal edges if the call was in the last statement. * tree-optimize.c (has_abnormal_outgoing_edge_p): New predicate. (execute_fixup_cfg): If there are non-local labels in the function, scan the basic blocks and split them at calls that can go to non-local labels or add missing abnormal call edges. Write down the CFG in the dump file. (pass_fixup_cfg): Remove TODO_dump_func flag. * unwind-sjlj.c: Poison setjmp. * doc/install.texi (enable-sjlj-exceptions): Use more general wording. * doc/tm.texi (DWARF2_UNWIND_INFO): Likewise. (TARGET_UNWIND_TABLES_DEFAULT): Fix typo. (DONT_USE_BUILTIN_SETJMP): Document it. From-SVN: r117298
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index baca834..61b1dab 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1930,6 +1930,7 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
edge e;
block_stmt_iterator bsi, stmt_bsi;
bool successfully_inlined = FALSE;
+ bool purge_dead_abnormal_edges;
tree t_step;
tree var;
@@ -2024,30 +2025,36 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
#endif
/* We will be inlining this callee. */
-
id->eh_region = lookup_stmt_eh_region (stmt);
/* Split the block holding the CALL_EXPR. */
-
e = split_block (bb, stmt);
bb = e->src;
return_block = e->dest;
remove_edge (e);
- /* split_block splits before the statement, work around this by moving
- the call into the first half_bb. Not pretty, but seems easier than
- doing the CFG manipulation by hand when the CALL_EXPR is in the last
- statement in BB. */
+ /* split_block splits after the statement; work around this by
+ moving the call into the second block manually. Not pretty,
+ but seems easier than doing the CFG manipulation by hand
+ when the CALL_EXPR is in the last statement of BB. */
stmt_bsi = bsi_last (bb);
+ bsi_remove (&stmt_bsi, false);
+
+ /* If the CALL_EXPR was in the last statement of BB, it may have
+ been the source of abnormal edges. In this case, schedule
+ the removal of dead abnormal edges. */
bsi = bsi_start (return_block);
- if (!bsi_end_p (bsi))
- bsi_move_before (&stmt_bsi, &bsi);
- else
+ if (bsi_end_p (bsi))
{
- tree stmt = bsi_stmt (stmt_bsi);
- bsi_remove (&stmt_bsi, false);
bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
+ purge_dead_abnormal_edges = true;
}
+ else
+ {
+ bsi_insert_before (&bsi, stmt, BSI_NEW_STMT);
+ purge_dead_abnormal_edges = false;
+ }
+
stmt_bsi = bsi_start (return_block);
/* Build a block containing code to initialize the arguments, the
@@ -2147,9 +2154,8 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
tsi_delink() will leave the iterator in a sane state. */
bsi_remove (&stmt_bsi, true);
- bsi_next (&bsi);
- if (bsi_end_p (bsi))
- tree_purge_dead_eh_edges (return_block);
+ if (purge_dead_abnormal_edges)
+ tree_purge_dead_abnormal_call_edges (return_block);
/* If the value of the new expression is ignored, that's OK. We
don't warn about this for CALL_EXPRs, so we shouldn't warn about