Commit 2aec79e2 by Doug Evans

(find_basic_blocks): Only perform n_basic_blocks sanity check on first pass...

(find_basic_blocks): Only perform n_basic_blocks sanity
check on first pass, and on second pass ensure it has the correct value.

From-SVN: r9671
parent 64c01f80
...@@ -485,8 +485,12 @@ find_basic_blocks (f, nonlocal_label_list) ...@@ -485,8 +485,12 @@ find_basic_blocks (f, nonlocal_label_list)
prev_code = code; prev_code = code;
} }
if (i + 1 != n_basic_blocks) /* During the second pass, `n_basic_blocks' is only an upper bound.
Only perform the sanity check for the first pass, and on the second
pass ensure `n_basic_blocks' is set to the correct value. */
if (pass == 1 && i + 1 != n_basic_blocks)
abort (); abort ();
n_basic_blocks = i + 1;
/* Don't delete the labels (in this function) /* Don't delete the labels (in this function)
that are referenced by non-jump instructions. */ that are referenced by non-jump instructions. */
...@@ -743,6 +747,10 @@ find_basic_blocks (f, nonlocal_label_list) ...@@ -743,6 +747,10 @@ find_basic_blocks (f, nonlocal_label_list)
{ {
pass++; pass++;
n_basic_blocks -= deleted; n_basic_blocks -= deleted;
/* `n_basic_blocks' may not be correct at this point: two previously
separate blocks may now be merged. That's ok though as we
recalculate it during the second pass. It certainly can't be
any larger than the current value. */
goto restart; goto restart;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment