]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/55562 (FAIL: gcc.dg/sms-* on powerpc*-*-*)
authorJakub Jelinek <jakub@redhat.com>
Tue, 18 Dec 2012 21:40:29 +0000 (22:40 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 18 Dec 2012 21:40:29 +0000 (22:40 +0100)
PR target/55562
* sbitmap.c (bitmap_and, bitmap_xor, bitmap_ior): Return whether
dst sbitmap changed even if it doesn't have popcount.

From-SVN: r194591

gcc/ChangeLog
gcc/sbitmap.c

index 952c7e793e07b6c0bb849f7bd45b5f9a7dbd4075..7b103fe89be9c3b2354fd6584163489c8aaf40c8 100644 (file)
@@ -1,3 +1,9 @@
+2012-12-18  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/55562
+       * sbitmap.c (bitmap_and, bitmap_xor, bitmap_ior): Return whether
+       dst sbitmap changed even if it doesn't have popcount.
+
 2012-12-18  James Greenhalgh  <james.greenhalgh@arm.com>
 
        * config/aarch64/aarch64.md (insv_imm<mode>): Add modes
index b50c82e5e91b1c11d865b912d5d11f08fdc5a4b5..884c9a6573875d9925693c8ce9ba49323477f551 100644 (file)
@@ -434,28 +434,26 @@ bitmap_and (sbitmap dst, const_sbitmap a, const_sbitmap b)
   const_sbitmap_ptr bp = b->elms;
   bool has_popcount = dst->popcount != NULL;
   unsigned char *popcountp = dst->popcount;
-  bool anychange = false;
+  SBITMAP_ELT_TYPE changed = 0;
 
   for (i = 0; i < n; i++)
     {
       const SBITMAP_ELT_TYPE tmp = *ap++ & *bp++;
+      SBITMAP_ELT_TYPE wordchanged = *dstp ^ tmp;
       if (has_popcount)
        {
-         bool wordchanged = (*dstp ^ tmp) != 0;
          if (wordchanged)
-           {
-             *popcountp = do_popcount (tmp);
-             anychange = true;
-           }
+           *popcountp = do_popcount (tmp);
          popcountp++;
        }
       *dstp++ = tmp;
+      changed |= wordchanged;
     }
 #ifdef BITMAP_DEBUGGING
   if (has_popcount)
     sbitmap_verify_popcount (dst);
 #endif
-  return anychange;
+  return changed != 0;
 }
 
 /* Set DST to be (A xor B)).
@@ -470,28 +468,26 @@ bitmap_xor (sbitmap dst, const_sbitmap a, const_sbitmap b)
   const_sbitmap_ptr bp = b->elms;
   bool has_popcount = dst->popcount != NULL;
   unsigned char *popcountp = dst->popcount;
-  bool anychange = false;
+  SBITMAP_ELT_TYPE changed = 0;
 
   for (i = 0; i < n; i++)
     {
       const SBITMAP_ELT_TYPE tmp = *ap++ ^ *bp++;
+      SBITMAP_ELT_TYPE wordchanged = *dstp ^ tmp;
       if (has_popcount)
        {
-         bool wordchanged = (*dstp ^ tmp) != 0;
          if (wordchanged)
-           {
-             *popcountp = do_popcount (tmp);
-             anychange = true;
-           }
+           *popcountp = do_popcount (tmp);
          popcountp++;
        }
       *dstp++ = tmp;
+      changed |= wordchanged;
     }
 #ifdef BITMAP_DEBUGGING
   if (has_popcount)
     sbitmap_verify_popcount (dst);
 #endif
-  return anychange;
+  return changed != 0;
 }
 
 /* Set DST to be (A or B)).
@@ -506,28 +502,26 @@ bitmap_ior (sbitmap dst, const_sbitmap a, const_sbitmap b)
   const_sbitmap_ptr bp = b->elms;
   bool has_popcount = dst->popcount != NULL;
   unsigned char *popcountp = dst->popcount;
-  bool anychange = false;
+  SBITMAP_ELT_TYPE changed = 0;
 
   for (i = 0; i < n; i++)
     {
       const SBITMAP_ELT_TYPE tmp = *ap++ | *bp++;
+      SBITMAP_ELT_TYPE wordchanged = *dstp ^ tmp;
       if (has_popcount)
        {
-         bool wordchanged = (*dstp ^ tmp) != 0;
          if (wordchanged)
-           {
-             *popcountp = do_popcount (tmp);
-             anychange = true;
-           }
+           *popcountp = do_popcount (tmp);
          popcountp++;
        }
       *dstp++ = tmp;
+      changed |= wordchanged;
     }
 #ifdef BITMAP_DEBUGGING
   if (has_popcount)
     sbitmap_verify_popcount (dst);
 #endif
-  return anychange;
+  return changed != 0;
 }
 
 /* Return nonzero if A is a subset of B.  */