diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-12-18 22:40:29 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2012-12-18 22:40:29 +0100 |
commit | fcf7ca2a9ee9a8742db9f041b6379cbd2afedf66 (patch) | |
tree | fa4695a1fac95ed4c12dda4bdb61642a7e102c3b /gcc/sbitmap.c | |
parent | 0b81f26c304d304e6a239e04408de47e02c8625b (diff) | |
download | gcc-fcf7ca2a9ee9a8742db9f041b6379cbd2afedf66.zip gcc-fcf7ca2a9ee9a8742db9f041b6379cbd2afedf66.tar.gz gcc-fcf7ca2a9ee9a8742db9f041b6379cbd2afedf66.tar.bz2 |
re PR target/55562 (FAIL: gcc.dg/sms-* on powerpc*-*-*)
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
Diffstat (limited to 'gcc/sbitmap.c')
-rw-r--r-- | gcc/sbitmap.c | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c index b50c82e..884c9a6 100644 --- a/gcc/sbitmap.c +++ b/gcc/sbitmap.c @@ -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. */ |