diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-22 14:44:24 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-22 14:44:24 +0000 |
commit | a98d46f2430b169ee3222028f589e9d0927845aa (patch) | |
tree | fa1b45a3f86cadecee7fb6f62ac6656a09e25cb7 /gcc/bitmap.c | |
parent | e4563f0dfa7f1b26309630ed0b91ea96cc256755 (diff) | |
download | gcc-a98d46f2430b169ee3222028f589e9d0927845aa.tar.gz |
* bitmap.c (bitmap_clear_bit): Micro optimize.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161189 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/bitmap.c')
-rw-r--r-- | gcc/bitmap.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/bitmap.c b/gcc/bitmap.c index aeaf2ea00e1..f2fd2bdb510 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; } |