On Wed, Dec 28, 2011 at 07:31:57PM +0100, Jan Hubicka wrote: > *** cfgloopmanip.c (revision 182708) > --- cfgloopmanip.c (working copy) > *************** remove_path (edge e) > *** 290,295 **** > --- 290,296 ---- > int i, nrem, n_bord_bbs; > sbitmap seen; > bool irred_invalidated = false; > + edge_iterator ei; > > if (!can_remove_branch_p (e)) > return false; > *************** remove_path (edge e) > *** 329,337 **** > /* Find "border" hexes -- i.e. those with predecessor in removed path. */ > for (i = 0; i < nrem; i++) > SET_BIT (seen, rem_bbs[i]->index); > for (i = 0; i < nrem; i++) > { > - edge_iterator ei; > bb = rem_bbs[i]; > FOR_EACH_EDGE (ae, ei, rem_bbs[i]->succs) > if (ae->dest != EXIT_BLOCK_PTR && !TEST_BIT (seen, ae->dest->index)) > --- 330,341 ---- > /* Find "border" hexes -- i.e. those with predecessor in removed path. */ > for (i = 0; i < nrem; i++) > SET_BIT (seen, rem_bbs[i]->index); > + FOR_EACH_EDGE (ae, ei, e->src->succs) > + if (ae != e && ae->dest != EXIT_BLOCK_PTR && !TEST_BIT (seen, > ae->dest->index) > + && ae->flags & EDGE_IRREDUCIBLE_LOOP) > + irred_invalidated = true;
Just a nit, can't you break out of the loop when irred_invalidated is set to true as well? There is no need to look through any further edges. I.e. perhaps: if (!irred_invalidated) FOR_EACH_EDGE (ae, ei, e->src->succs) if (ae != e && ae->dest != EXIT_BLOCK_PTR && (ae->flags & EDGE_IRREDUCIBLE_LOOP) && !TEST_BIT (seen, ae->dest->index)) { irred_invalidated = true; break; } Thanks for looking into this, I'll defer the review to somebody familiar with cfgloopmanip.c though. Jakub