* bitmap.c (bitmap_clear_bit): Micro optimize.
authorUros Bizjak <ubizjak@gmail.com>
Tue, 22 Jun 2010 14:44:24 +0000 (16:44 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 22 Jun 2010 14:44:24 +0000 (14:44 +0000)
From-SVN: r161189

gcc/ChangeLog
gcc/bitmap.c

index ca0ebf5..b3aae11 100644 (file)
@@ -1,5 +1,9 @@
 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.
        (SWI48x): Ditto.
        (SWI12): Ditto.
index aeaf2ea..f2fd2bd 100644 (file)
@@ -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;
     }