From: Richard Kenner Date: Wed, 9 Jun 2004 00:10:51 +0000 (+0000) Subject: toplev.c (floor_log2_wide): Correct casts for 64-bit hosts. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=144cbad04be7523a756f608fcd3037120057e8e6;p=gcc.git toplev.c (floor_log2_wide): Correct casts for 64-bit hosts. * toplev.c (floor_log2_wide): Correct casts for 64-bit hosts. Correct formatting. From-SVN: r82798 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9bc153f3afd..a42b594d294 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-06-08 Richard Kenner + + * toplev.c (floor_log2_wide): Correct casts for 64-bit hosts. + Correct formatting. + 2004-06-08 James E Wilson PR target/15790 diff --git a/gcc/toplev.c b/gcc/toplev.c index e1803943d9c..cec53fb6974 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1259,21 +1259,21 @@ floor_log2_wide (unsigned HOST_WIDE_INT x) int t=0; if (x == 0) return -1; - if (sizeof (HOST_WIDE_INT)*8 > 64) - if (x >= (unsigned HOST_WIDE_INT)(1 << (t+64))) + if (sizeof (HOST_WIDE_INT) * 8 > 64) + if (x >= (unsigned HOST_WIDE_INT) 1 << (t + 64)) t += 64; - if (sizeof (HOST_WIDE_INT)*8 > 32) - if (x >= (unsigned HOST_WIDE_INT)(1 << (t+32))) + if (sizeof (HOST_WIDE_INT) * 8 > 32) + if (x >= ((unsigned HOST_WIDE_INT) 1) << (t + 32)) t += 32; - if (x >= (unsigned HOST_WIDE_INT)(1 << (t+16))) + if (x >= ((unsigned HOST_WIDE_INT) 1) << (t + 16)) t += 16; - if (x >= (unsigned HOST_WIDE_INT)(1 << (t+8))) + if (x >= ((unsigned HOST_WIDE_INT) 1) << (t + 8)) t += 8; - if (x >= (unsigned HOST_WIDE_INT)(1 << (t+4))) + if (x >= ((unsigned HOST_WIDE_INT) 1) << (t + 4)) t += 4; - if (x >= (unsigned HOST_WIDE_INT)(1 << (t+2))) + if (x >= ((unsigned HOST_WIDE_INT) 1) << (t + 2)) t += 2; - if (x >= (unsigned HOST_WIDE_INT)(1 << (t+1))) + if (x >= ((unsigned HOST_WIDE_INT) 1) << (t + 1)) t += 1; return t; }