aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-06-09 20:20:33 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-06-09 18:20:33 +0000
commita2b709cc11de270599d1758f1d2c5a17e920c432 (patch)
tree7f819d458483e9b129c6a2bdc7b91cd9a5bfeba0 /gcc
parentd2081406d207b56191aac9fec98fc52f842f51ee (diff)
downloadgcc-a2b709cc11de270599d1758f1d2c5a17e920c432.zip
gcc-a2b709cc11de270599d1758f1d2c5a17e920c432.tar.gz
gcc-a2b709cc11de270599d1758f1d2c5a17e920c432.tar.bz2
bitmap.c (bitmap_and): Walk array forward.
* bitmap.c (bitmap_and): Walk array forward. (bitmap_and_compl_into): Likewise. (bitmap_xor): Likewise. (bitmap_xor_into): Likewise. (bitmap_equal_p): Likewise. (bitmap_intersect_p): Likewise. (bitmap_intersect_compl_p): Likewise. (bitmap_ior_and_into): Likewise. (bitmap_elt_copy): Likewise. (bitmap_and_compl): Likewise. (bitmap_elt_ior): Likewise. From-SVN: r160502
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/bitmap.c32
2 files changed, 30 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a56970d..8c322d0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2010-06-09 Jan Hubicka <jh@suse.cz>
+
+ * bitmap.c (bitmap_and): Walk array forward.
+ (bitmap_and_compl_into): Likewise.
+ (bitmap_xor): Likewise.
+ (bitmap_xor_into): Likewise.
+ (bitmap_equal_p): Likewise.
+ (bitmap_intersect_p): Likewise.
+ (bitmap_intersect_compl_p): Likewise.
+ (bitmap_ior_and_into): Likewise.
+ (bitmap_elt_copy): Likewise.
+ (bitmap_and_compl): Likewise.
+ (bitmap_elt_ior): Likewise.
+
2010-06-09 Dave Korn <dave.korn.cygwin@gmail.com>
* opts-common.c (prune_options): Ensure replacement argv array
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index 21a05fc..87de652 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -908,7 +908,7 @@ bitmap_and (bitmap dst, const_bitmap a, const_bitmap b)
dst_elt = bitmap_elt_insert_after (dst, dst_prev, a_elt->indx);
else
dst_elt->indx = a_elt->indx;
- for (ix = BITMAP_ELEMENT_WORDS; ix--;)
+ for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{
BITMAP_WORD r = a_elt->bits[ix] & b_elt->bits[ix];
@@ -960,7 +960,7 @@ bitmap_and_into (bitmap a, const_bitmap b)
unsigned ix;
BITMAP_WORD ior = 0;
- for (ix = BITMAP_ELEMENT_WORDS; ix--;)
+ for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{
BITMAP_WORD r = a_elt->bits[ix] & b_elt->bits[ix];
@@ -992,7 +992,7 @@ bitmap_elt_copy (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev,
{
unsigned ix;
- for (ix = BITMAP_ELEMENT_WORDS; ix--;)
+ for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
if (src_elt->bits[ix] != dst_elt->bits[ix])
{
dst_elt->bits[ix] = src_elt->bits[ix];
@@ -1056,7 +1056,7 @@ bitmap_and_compl (bitmap dst, const_bitmap a, const_bitmap b)
if (!changed && dst_elt && dst_elt->indx == a_elt->indx)
{
- for (ix = BITMAP_ELEMENT_WORDS; ix--;)
+ for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{
BITMAP_WORD r = a_elt->bits[ix] & ~b_elt->bits[ix];
@@ -1082,7 +1082,7 @@ bitmap_and_compl (bitmap dst, const_bitmap a, const_bitmap b)
new_element = false;
}
- for (ix = BITMAP_ELEMENT_WORDS; ix--;)
+ for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{
BITMAP_WORD r = a_elt->bits[ix] & ~b_elt->bits[ix];
@@ -1159,7 +1159,7 @@ bitmap_and_compl_into (bitmap a, const_bitmap b)
unsigned ix;
BITMAP_WORD ior = 0;
- for (ix = BITMAP_ELEMENT_WORDS; ix--;)
+ for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{
BITMAP_WORD cleared = a_elt->bits[ix] & b_elt->bits[ix];
BITMAP_WORD r = a_elt->bits[ix] ^ cleared;
@@ -1453,7 +1453,7 @@ bitmap_compl_and_into (bitmap a, const_bitmap b)
unsigned ix;
BITMAP_WORD ior = 0;
- for (ix = BITMAP_ELEMENT_WORDS; ix--;)
+ for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{
BITMAP_WORD cleared = a_elt->bits[ix] & b_elt->bits[ix];
BITMAP_WORD r = b_elt->bits[ix] ^ cleared;
@@ -1494,7 +1494,7 @@ bitmap_elt_ior (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev,
if (!changed && dst_elt && dst_elt->indx == a_elt->indx)
{
- for (ix = BITMAP_ELEMENT_WORDS; ix--;)
+ for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{
BITMAP_WORD r = a_elt->bits[ix] | b_elt->bits[ix];
if (r != dst_elt->bits[ix])
@@ -1511,7 +1511,7 @@ bitmap_elt_ior (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev,
dst_elt = bitmap_elt_insert_after (dst, dst_prev, a_elt->indx);
else
dst_elt->indx = a_elt->indx;
- for (ix = BITMAP_ELEMENT_WORDS; ix--;)
+ for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{
BITMAP_WORD r = a_elt->bits[ix] | b_elt->bits[ix];
dst_elt->bits[ix] = r;
@@ -1650,7 +1650,7 @@ bitmap_xor (bitmap dst, const_bitmap a, const_bitmap b)
dst_elt = bitmap_elt_insert_after (dst, dst_prev, a_elt->indx);
else
dst_elt->indx = a_elt->indx;
- for (ix = BITMAP_ELEMENT_WORDS; ix--;)
+ for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{
BITMAP_WORD r = a_elt->bits[ix] ^ b_elt->bits[ix];
@@ -1735,7 +1735,7 @@ bitmap_xor_into (bitmap a, const_bitmap b)
BITMAP_WORD ior = 0;
bitmap_element *next = a_elt->next;
- for (ix = BITMAP_ELEMENT_WORDS; ix--;)
+ for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{
BITMAP_WORD r = a_elt->bits[ix] ^ b_elt->bits[ix];
@@ -1772,7 +1772,7 @@ bitmap_equal_p (const_bitmap a, const_bitmap b)
{
if (a_elt->indx != b_elt->indx)
return false;
- for (ix = BITMAP_ELEMENT_WORDS; ix--;)
+ for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
if (a_elt->bits[ix] != b_elt->bits[ix])
return false;
}
@@ -1797,7 +1797,7 @@ bitmap_intersect_p (const_bitmap a, const_bitmap b)
b_elt = b_elt->next;
else
{
- for (ix = BITMAP_ELEMENT_WORDS; ix--;)
+ for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
if (a_elt->bits[ix] & b_elt->bits[ix])
return true;
a_elt = a_elt->next;
@@ -1824,7 +1824,7 @@ bitmap_intersect_compl_p (const_bitmap a, const_bitmap b)
b_elt = b_elt->next;
else
{
- for (ix = BITMAP_ELEMENT_WORDS; ix--;)
+ for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
if (a_elt->bits[ix] & ~b_elt->bits[ix])
return true;
a_elt = a_elt->next;
@@ -1880,7 +1880,7 @@ bitmap_ior_and_compl (bitmap dst, const_bitmap a, const_bitmap b, const_bitmap k
BITMAP_WORD ior = 0;
tmp_elt.indx = b_elt->indx;
- for (ix = BITMAP_ELEMENT_WORDS; ix--;)
+ for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{
BITMAP_WORD r = b_elt->bits[ix] & ~kill_elt->bits[ix];
ior |= r;
@@ -1998,7 +1998,7 @@ bitmap_ior_and_into (bitmap a, const_bitmap b, const_bitmap c)
overall = 0;
and_elt.indx = b_elt->indx;
- for (ix = BITMAP_ELEMENT_WORDS; ix--;)
+ for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{
and_elt.bits[ix] = b_elt->bits[ix] & c_elt->bits[ix];
overall |= and_elt.bits[ix];