Commit 0c8eb998 by Richard Henderson Committed by Richard Henderson

* trans-const.c (gfc_conv_mpz_to_tree): Fix 64-bit shift warning.

From-SVN: r86504
parent 9e995780
2004-08-24 Richard Henderson <rth@redhat.com>
* trans-const.c (gfc_conv_mpz_to_tree): Fix 64-bit shift warning.
2004-08-24 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> 2004-08-24 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* resolve.c (merge_argument_lists): Revert unintentionally * resolve.c (merge_argument_lists): Revert unintentionally
......
...@@ -187,21 +187,22 @@ gfc_conv_mpz_to_tree (mpz_t i, int kind) ...@@ -187,21 +187,22 @@ gfc_conv_mpz_to_tree (mpz_t i, int kind)
else if (sizeof (mp_limb_t) == 2 * sizeof (HOST_WIDE_INT)) else if (sizeof (mp_limb_t) == 2 * sizeof (HOST_WIDE_INT))
{ {
mp_limb_t limb0 = mpz_getlimbn (i, 0); mp_limb_t limb0 = mpz_getlimbn (i, 0);
int count = (sizeof (mp_limb_t) - sizeof (HOST_WIDE_INT)) * CHAR_BIT; int shift = (sizeof (mp_limb_t) - sizeof (HOST_WIDE_INT)) * CHAR_BIT;
low = limb0; low = limb0;
high = limb0 >> count; high = limb0 >> shift;
} }
else if (sizeof (mp_limb_t) < sizeof (HOST_WIDE_INT)) else if (sizeof (mp_limb_t) < sizeof (HOST_WIDE_INT))
{ {
int shift = sizeof (mp_limb_t) * CHAR_BIT;
int n, count = sizeof (HOST_WIDE_INT) / sizeof (mp_limb_t); int n, count = sizeof (HOST_WIDE_INT) / sizeof (mp_limb_t);
for (low = n = 0; n < count; ++n) for (low = n = 0; n < count; ++n)
{ {
low <<= sizeof (mp_limb_t) * CHAR_BIT; low <<= shift;
low |= mpz_getlimbn (i, n); low |= mpz_getlimbn (i, n);
} }
for (high = 0; n < 2*count; ++n) for (high = 0, n = count; n < 2*count; ++n)
{ {
high <<= sizeof (mp_limb_t) * CHAR_BIT; high <<= shift;
high |= mpz_getlimbn (i, n); high |= mpz_getlimbn (i, n);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment