aboutsummaryrefslogtreecommitdiff
path: root/gcc/resource.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/resource.c')
-rw-r--r--gcc/resource.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/resource.c b/gcc/resource.c
index ea91583..644a031 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -133,7 +133,7 @@ find_basic_block (insn, search_limit)
rtx insn;
int search_limit;
{
- int i;
+ basic_block bb;
/* Scan backwards to the previous BARRIER. Then see if we can find a
label that starts a basic block. Return the basic block number. */
@@ -156,9 +156,9 @@ find_basic_block (insn, search_limit)
insn && GET_CODE (insn) == CODE_LABEL;
insn = next_nonnote_insn (insn))
{
- for (i = 0; i < n_basic_blocks; i++)
- if (insn == BLOCK_HEAD (i))
- return i;
+ FOR_EACH_BB (bb)
+ if (insn == bb->head)
+ return bb->index;
}
return -1;