http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46649
--- Comment #7 from Alexander Monakov <amonakov at gcc dot gnu.org> 2010-12-14
14:38:38 UTC ---
After a discussion with Andrey and refreshing my memory on that code I think
it's actually better to unbreak purge_empty_blocks in this case. It used to be
correct, i.e. it never attempted to delete the first BB in the region; then I
broke it because I wasn't aware of the limitation w.r.t. removal of the first
BB.
Sorry for the spam.
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index 427fd22..9f0c4a3 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -3749,10 +3749,10 @@ tidy_control_flow (basic_block xbb, bool full_tidying)
void
purge_empty_blocks (void)
{
- /* Do not attempt to delete preheader. */
- int i = sel_is_loop_preheader_p (BASIC_BLOCK (BB_TO_BLOCK (0))) ? 1 : 0;
+ int i;
- while (i < current_nr_blocks)
+ /* Do not attempt to delete the first basic block in the region. */
+ for (i = 1; i < current_nr_blocks; i++)
{
basic_block b = BASIC_BLOCK (BB_TO_BLOCK (i));