diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ca0ebf53abf2dfbf980de1f9b8da09556dba3afd..b3aae11cf09b489d8289988e1de4541cb584a1c1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2010-06-22 Uros Bizjak <ubizjak@gmail.com> + + * bitmap.c (bitmap_clear_bit): Micro optimize. + 2010-06-22 Uros Bizjak <ubizjak@gmail.com> * config/i386/i386.md (SWI1248x): New mode iterator. diff --git a/gcc/bitmap.c b/gcc/bitmap.c index aeaf2ea00e1ce779185a9cb2f83f8da10402e4b9..f2fd2bdb510a1ee23b12c3c1722634e68064142c 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; }