This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
rs6000 warning fixes
- To: gcc-patches at gcc dot gnu dot org
- Subject: rs6000 warning fixes
- From: Alan Modra <amodra at bigpond dot net dot au>
- Date: Thu, 6 Sep 2001 11:46:23 +0930
Approved offline by David Edelsohn.
* 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.
--
Alan Modra
Index: gcc/config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.167.2.10
diff -u -p -r1.167.2.10 rs6000.c
--- rs6000.c 2001/09/05 12:51:14 1.167.2.10
+++ rs6000.c 2001/09/06 00:36:45
@@ -1089,7 +1089,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;
@@ -1133,7 +1133,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. */
@@ -1152,7 +1152,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);
@@ -3418,13 +3418,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 == ~0)
return 0;
- shift_mask = ~(unsigned HOST_WIDE_INT) 0;
+ shift_mask = ~0;
shift_mask <<= INTVAL (shiftop);
/* Find the least signifigant one bit. */
@@ -3447,8 +3447,8 @@ 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)
@@ -3460,7 +3460,7 @@ includes_rldic_lshift_p (shiftop, andop)
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;
@@ -3476,7 +3476,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;
@@ -3513,10 +3513,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);
@@ -3534,19 +3533,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;
@@ -3561,7 +3560,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;
----- End forwarded message -----