diff options
author | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2007-02-04 23:51:28 +0000 |
---|---|---|
committer | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2007-02-04 23:51:28 +0000 |
commit | 83bd032b4b837724b81c7db25be205771311a3a3 (patch) | |
tree | cb5883febf06ea7e39d3e7a41458c08e927af1a5 /gcc | |
parent | 14fa2cc05762323f22f92cdb1dee039277bc6292 (diff) | |
download | gcc-83bd032b4b837724b81c7db25be205771311a3a3.zip gcc-83bd032b4b837724b81c7db25be205771311a3a3.tar.gz gcc-83bd032b4b837724b81c7db25be205771311a3a3.tar.bz2 |
cfgcleanup.c (try_optimize_cfg): Avoid removing ENTRY_BLOCK_PTR.
* cfgcleanup.c (try_optimize_cfg): Avoid removing ENTRY_BLOCK_PTR.
From-SVN: r121584
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cfgcleanup.c | 6 |
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. */ |