aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-const.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-08-24 11:23:11 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-08-24 11:23:11 -0700
commit0c8eb9985d66ce596412f676313d1dcbeaebd210 (patch)
tree54a8190b00743cb6e5baa70562e3b29354cdd86d /gcc/fortran/trans-const.c
parent9e995780d4d716b31b8c9da99b34d3eefe96a3b1 (diff)
downloadgcc-0c8eb9985d66ce596412f676313d1dcbeaebd210.zip
gcc-0c8eb9985d66ce596412f676313d1dcbeaebd210.tar.gz
gcc-0c8eb9985d66ce596412f676313d1dcbeaebd210.tar.bz2
* trans-const.c (gfc_conv_mpz_to_tree): Fix 64-bit shift warning.
From-SVN: r86504
Diffstat (limited to 'gcc/fortran/trans-const.c')
-rw-r--r--gcc/fortran/trans-const.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/fortran/trans-const.c b/gcc/fortran/trans-const.c
index c2a68b7..110c0db 100644
--- a/gcc/fortran/trans-const.c
+++ b/gcc/fortran/trans-const.c
@@ -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))
{
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;
- high = limb0 >> count;
+ high = limb0 >> shift;
}
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);
for (low = n = 0; n < count; ++n)
{
- low <<= sizeof (mp_limb_t) * CHAR_BIT;
+ low <<= shift;
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);
}
}