From: Richard Earnshaw Date: Fri, 24 May 2002 12:23:36 +0000 (+0000) Subject: bitmap.c (bitmap_find_bit): Return early if we have the correct element cached. X-Git-Tag: releases/gcc-3.1.1~280 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ad29c77b0a59238f906771cd4a785a87dc4936b;p=thirdparty%2Fgcc.git bitmap.c (bitmap_find_bit): Return early if we have the correct element cached. 2002-05-21 Richard Earnshaw * bitmap.c (bitmap_find_bit): Return early if we have the correct element cached. From-SVN: r53838 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 68f8af258c10..dde3ea05e2ca 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-05-21 Richard Earnshaw + + * bitmap.c (bitmap_find_bit): Return early if we have the correct + element cached. + 2002-05-24 Neil Booth * cppinit.c (mark_named_operators): Split out from init_builtins. diff --git a/gcc/bitmap.c b/gcc/bitmap.c index b735d1409d0b..786689b4ad52 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -300,8 +300,9 @@ bitmap_find_bit (head, bit) bitmap_element *element; unsigned HOST_WIDE_INT indx = bit / BITMAP_ELEMENT_ALL_BITS; - if (head->current == 0) - return 0; + if (head->current == 0 + || head->indx == indx) + return head->current; if (head->indx > indx) for (element = head->current;