aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cfgcleanup.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index acb109e..f458ac7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2007-02-04 Zdenek Dvorak <dvorakz@suse.cz>
+ * cfgcleanup.c (try_optimize_cfg): Avoid removing ENTRY_BLOCK_PTR.
+
+2007-02-04 Zdenek Dvorak <dvorakz@suse.cz>
+
* cfgloopmanip.c (loop_delete_branch_edge): Removed.
(remove_path): Use can_remove_branch_p and remove_branch instead
of loop_delete_branch_edge.
@@ -43,7 +47,7 @@
* passes.c (init_optimization_passes): Reindent.
2007-02-04 Jan Hubicka <jh@suse.cz>
- Eric Botcazou <ebotcazou@adacore.com>
+ Eric Botcazou <ebotcazou@adacore.com>
* tree-optimize.c (has_abnormal_outgoing_edge_p): Move to...
(execute_fixup_cfg): Break out the abnormal goto code.
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 7c5b745..ee5c69b 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -1992,7 +1992,7 @@ try_optimize_cfg (int mode)
bool changed_here = false;
/* Delete trivially dead basic blocks. */
- while (EDGE_COUNT (b->preds) == 0)
+ if (EDGE_COUNT (b->preds) == 0)
{
c = b->prev_bb;
if (dump_file)
@@ -2002,7 +2002,9 @@ try_optimize_cfg (int mode)
delete_basic_block (b);
if (!(mode & CLEANUP_CFGLAYOUT))
changed = true;
- b = c;
+ /* Avoid trying to remove ENTRY_BLOCK_PTR. */
+ b = (c == ENTRY_BLOCK_PTR ? c->next_bb : c);
+ continue;
}
/* Remove code labels no longer used. */