aboutsummaryrefslogtreecommitdiff
path: root/gcc/bitmap.c
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2010-06-22 16:44:24 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-06-22 14:44:24 +0000
commit07309d58d08122d67d722bc297eb371d9788488c (patch)
treefa1b45a3f86cadecee7fb6f62ac6656a09e25cb7 /gcc/bitmap.c
parentb0256cb6d28d3121f4bcba03da55979a4a467bd7 (diff)
downloadgcc-07309d58d08122d67d722bc297eb371d9788488c.zip
gcc-07309d58d08122d67d722bc297eb371d9788488c.tar.gz
gcc-07309d58d08122d67d722bc297eb371d9788488c.tar.bz2
* bitmap.c (bitmap_clear_bit): Micro optimize.
From-SVN: r161189
Diffstat (limited to 'gcc/bitmap.c')
-rw-r--r--gcc/bitmap.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index aeaf2ea..f2fd2bd 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -624,11 +624,13 @@ bitmap_clear_bit (bitmap head, int bit)
BITMAP_WORD bit_val = ((BITMAP_WORD) 1) << bit_num;
bool res = (ptr->bits[word_num] & bit_val) != 0;
if (res)
- ptr->bits[word_num] &= ~bit_val;
-
- /* If we cleared the entire word, free up the element. */
- if (bitmap_element_zerop (ptr))
- bitmap_element_free (head, ptr);
+ {
+ ptr->bits[word_num] &= ~bit_val;
+ /* If we cleared the entire word, free up the element. */
+ if (!ptr->bits[word_num]
+ && bitmap_element_zerop (ptr))
+ bitmap_element_free (head, ptr);
+ }
return res;
}