re PR middle-end/42229 (cancel_loop_tree: bad read causes ice)

2009-12-02  Richard Guenther  <rguenther@suse.de>

	PR middle-end/42229
	* cfgloopmanip.c (remove_path): Avoid cancelling loops
	twice.

From-SVN: r154914
This commit is contained in:
Richard Guenther 2009-12-02 15:22:01 +00:00 committed by Richard Biener
parent ca6f617420
commit 2f697bc476
2 changed files with 8 additions and 9 deletions

View File

@ -1,3 +1,9 @@
2009-12-02 Richard Guenther <rguenther@suse.de>
PR middle-end/42229
* cfgloopmanip.c (remove_path): Avoid cancelling loops
twice.
2009-12-02 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
PR middle-end/42224

View File

@ -278,10 +278,9 @@ remove_path (edge e)
edge ae;
basic_block *rem_bbs, *bord_bbs, from, bb;
VEC (basic_block, heap) *dom_bbs;
int i, nrem, n_bord_bbs, nreml;
int i, nrem, n_bord_bbs;
sbitmap seen;
bool irred_invalidated = false;
struct loop **deleted_loop;
if (!can_remove_branch_p (e))
return false;
@ -342,15 +341,9 @@ remove_path (edge e)
dom_bbs = NULL;
/* Cancel loops contained in the path. */
deleted_loop = XNEWVEC (struct loop *, nrem);
nreml = 0;
for (i = 0; i < nrem; i++)
if (rem_bbs[i]->loop_father->header == rem_bbs[i])
deleted_loop[nreml++] = rem_bbs[i]->loop_father;
for (i = 0; i < nreml; i++)
cancel_loop_tree (deleted_loop[i]);
free (deleted_loop);
cancel_loop_tree (rem_bbs[i]->loop_father);
remove_bbs (rem_bbs, nrem);
free (rem_bbs);