aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfgcleanup.c
diff options
context:
space:
mode:
authorZdenek Dvorak <rakdver@gcc.gnu.org>2006-02-14 23:55:22 +0000
committerZdenek Dvorak <rakdver@gcc.gnu.org>2006-02-14 23:55:22 +0000
commit43ec2467a85e470e356cd39441285a128b4febad (patch)
tree3c6b81a1f48e064bd66b687c972d0a714dd6b1b1 /gcc/tree-cfgcleanup.c
parent0499513f3b8f457a62baed6473d7b26ee81edcb8 (diff)
downloadgcc-43ec2467a85e470e356cd39441285a128b4febad.zip
gcc-43ec2467a85e470e356cd39441285a128b4febad.tar.gz
gcc-43ec2467a85e470e356cd39441285a128b4febad.tar.bz2
re PR tree-optimization/26209 (Specific code causes g++ 4.1.0 dominance ICE when compiled with -O3)
PR tree-optimization/26209 * tree-ssa-loop.c (pass_scev_cprop): Add TODO_cleanup_cfg. * tree-cfgcleanup.c (cleanup_control_flow): Remove dead eh edges. * tree-cfg.c (replace_uses_by): Do not alter cfg. From-SVN: r110999
Diffstat (limited to 'gcc/tree-cfgcleanup.c')
-rw-r--r--gcc/tree-cfgcleanup.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index 76667a6..dc0380a 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -158,19 +158,24 @@ cleanup_control_flow (void)
{
bsi = bsi_last (bb);
+ /* If the last statement of the block could throw and now cannot,
+ we need to prune cfg. */
+ tree_purge_dead_eh_edges (bb);
+
if (bsi_end_p (bsi))
continue;
stmt = bsi_stmt (bsi);
+
if (TREE_CODE (stmt) == COND_EXPR
|| TREE_CODE (stmt) == SWITCH_EXPR)
retval |= cleanup_control_expr_graph (bb, bsi);
-
/* If we had a computed goto which has a compile-time determinable
destination, then we can eliminate the goto. */
- if (TREE_CODE (stmt) == GOTO_EXPR
- && TREE_CODE (GOTO_DESTINATION (stmt)) == ADDR_EXPR
- && TREE_CODE (TREE_OPERAND (GOTO_DESTINATION (stmt), 0)) == LABEL_DECL)
+ else if (TREE_CODE (stmt) == GOTO_EXPR
+ && TREE_CODE (GOTO_DESTINATION (stmt)) == ADDR_EXPR
+ && (TREE_CODE (TREE_OPERAND (GOTO_DESTINATION (stmt), 0))
+ == LABEL_DECL))
{
edge e;
tree label;
@@ -214,7 +219,7 @@ cleanup_control_flow (void)
/* Check for indirect calls that have been turned into
noreturn calls. */
- if (noreturn_call_p (stmt) && remove_fallthru_edge (bb->succs))
+ else if (noreturn_call_p (stmt) && remove_fallthru_edge (bb->succs))
{
free_dominance_info (CDI_DOMINATORS);
retval = true;