diff options
author | Alan Modra <amodra@bigpond.net.au> | 2001-09-06 02:19:58 +0000 |
---|---|---|
committer | Alan Modra <amodra@gcc.gnu.org> | 2001-09-06 11:49:58 +0930 |
commit | 02071907b27ad5a12f5a9f6aee844a054c246a39 (patch) | |
tree | 63da6143006af0ffec3707f15b2e3c3493dc7bb8 | |
parent | 89fc36051e8045d8bb086b3228c1aec280884097 (diff) | |
download | gcc-02071907b27ad5a12f5a9f6aee844a054c246a39.zip gcc-02071907b27ad5a12f5a9f6aee844a054c246a39.tar.gz gcc-02071907b27ad5a12f5a9f6aee844a054c246a39.tar.bz2 |
rs6000.c (mask_operand): Use signed vars to avoid compiler warnings.
* config/rs6000/rs6000.c (mask_operand): Use signed vars to avoid
compiler warnings.
(mask64_operand): Likewise.
(includes_rldic_lshift_p): Likewise.
(includes_rldicr_lshift_p): Likewise.
From-SVN: r45430
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 37 |
2 files changed, 25 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6605eb3..b0be444 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2001-09-06 Alan Modra <amodra@bigpond.net.au> + + * config/rs6000/rs6000.c (mask_operand): Use signed vars to avoid + compiler warnings. + (mask64_operand): Likewise. + (includes_rldic_lshift_p): Likewise. + (includes_rldicr_lshift_p): Likewise. + 2001-09-05 Ziemowit Laski <zlaski@apple.com> * objc/objc-act.c (build_message_expr): If a class method cannot diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index c902564..dcd2c32 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1158,7 +1158,7 @@ mask_operand (op, mode) register rtx op; enum machine_mode mode ATTRIBUTE_UNUSED; { - unsigned HOST_WIDE_INT c, lsb; + HOST_WIDE_INT c, lsb; if (GET_CODE (op) != CONST_INT) return 0; @@ -1202,7 +1202,7 @@ mask64_operand (op, mode) { if (GET_CODE (op) == CONST_INT) { - unsigned HOST_WIDE_INT c, lsb; + HOST_WIDE_INT c, lsb; /* We don't change the number of transitions by inverting, so make sure we start with the LS bit zero. */ @@ -1221,7 +1221,7 @@ mask64_operand (op, mode) else if (GET_CODE (op) == CONST_DOUBLE && (mode == VOIDmode || mode == DImode)) { - unsigned HOST_WIDE_INT low, high, lsb; + HOST_WIDE_INT low, high, lsb; if (HOST_BITS_PER_WIDE_INT < 64) high = CONST_DOUBLE_HIGH (op); @@ -3642,13 +3642,13 @@ includes_rldic_lshift_p (shiftop, andop) { if (GET_CODE (andop) == CONST_INT) { - unsigned HOST_WIDE_INT c, lsb, shift_mask; + HOST_WIDE_INT c, lsb, shift_mask; c = INTVAL (andop); - if (c == 0 || c == ~(unsigned HOST_WIDE_INT) 0) + if (c == 0 || c == ~0) return 0; - shift_mask = ~(unsigned HOST_WIDE_INT) 0; + shift_mask = ~0; shift_mask <<= INTVAL (shiftop); /* Find the least signifigant one bit. */ @@ -3671,22 +3671,20 @@ includes_rldic_lshift_p (shiftop, andop) else if (GET_CODE (andop) == CONST_DOUBLE && (GET_MODE (andop) == VOIDmode || GET_MODE (andop) == DImode)) { - unsigned HOST_WIDE_INT low, high, lsb; - unsigned HOST_WIDE_INT shift_mask_low, shift_mask_high; + HOST_WIDE_INT low, high, lsb; + HOST_WIDE_INT shift_mask_low, shift_mask_high; low = CONST_DOUBLE_LOW (andop); if (HOST_BITS_PER_WIDE_INT < 64) high = CONST_DOUBLE_HIGH (andop); if ((low == 0 && (HOST_BITS_PER_WIDE_INT >= 64 || high == 0)) - || (low == ~(unsigned HOST_WIDE_INT) 0 - && (HOST_BITS_PER_WIDE_INT >= 64 - || high == ~(unsigned HOST_WIDE_INT) 0))) + || (low == ~0 && (HOST_BITS_PER_WIDE_INT >= 64 || high == ~0))) return 0; if (HOST_BITS_PER_WIDE_INT < 64 && low == 0) { - shift_mask_high = ~(unsigned HOST_WIDE_INT) 0; + shift_mask_high = ~0; if (INTVAL (shiftop) > 32) shift_mask_high <<= INTVAL (shiftop) - 32; @@ -3702,7 +3700,7 @@ includes_rldic_lshift_p (shiftop, andop) return high == -lsb; } - shift_mask_low = ~(unsigned HOST_WIDE_INT) 0; + shift_mask_low = ~0; shift_mask_low <<= INTVAL (shiftop); lsb = low & -low; @@ -3739,10 +3737,9 @@ includes_rldicr_lshift_p (shiftop, andop) { if (GET_CODE (andop) == CONST_INT) { - unsigned HOST_WIDE_INT c, lsb; - unsigned HOST_WIDE_INT shift_mask; + HOST_WIDE_INT c, lsb, shift_mask; - shift_mask = ~(unsigned HOST_WIDE_INT) 0; + shift_mask = ~0; shift_mask <<= INTVAL (shiftop); c = INTVAL (andop); @@ -3760,19 +3757,19 @@ includes_rldicr_lshift_p (shiftop, andop) else if (GET_CODE (andop) == CONST_DOUBLE && (GET_MODE (andop) == VOIDmode || GET_MODE (andop) == DImode)) { - unsigned HOST_WIDE_INT low, lsb, shift_mask_low; + HOST_WIDE_INT low, lsb, shift_mask_low; low = CONST_DOUBLE_LOW (andop); if (HOST_BITS_PER_WIDE_INT < 64) { - unsigned HOST_WIDE_INT high, shift_mask_high; + HOST_WIDE_INT high, shift_mask_high; high = CONST_DOUBLE_HIGH (andop); if (low == 0) { - shift_mask_high = ~(unsigned HOST_WIDE_INT) 0; + shift_mask_high = ~0; if (INTVAL (shiftop) > 32) shift_mask_high <<= INTVAL (shiftop) - 32; @@ -3787,7 +3784,7 @@ includes_rldicr_lshift_p (shiftop, andop) return 0; } - shift_mask_low = ~(unsigned HOST_WIDE_INT) 0; + shift_mask_low = ~0; shift_mask_low <<= INTVAL (shiftop); lsb = low & -low; |