This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
patch for execute/920501-6.c
- To: tege at matematik dot su dot se
- Subject: patch for execute/920501-6.c
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Thu, 16 Oct 1997 22:29:20 +0100 (BST)
- Cc: egcs at cygnus dot com
sqrtllu shiftes an integer by a quantity that is 15 for the calls
in the test, and might be as high as 32 in general.
For a shift count of 15, this yields a negative value on hosts with 16 bit
ints. Herei s a fix:
*** execute/920501-6.c-old Fri Sep 5 17:16:00 1997
--- execute/920501-6.c Thu Oct 16 22:23:56 1997
*************** sqrtllu (long long unsigned t)
*** 33,39 ****
for (b = 0, s = t; b++, (s >>= 1) != 0; )
;
! s = 1 << (b >> 1);
if (b & 1)
s += s >> 1;
--- 33,39 ----
for (b = 0, s = t; b++, (s >>= 1) != 0; )
;
! s = 1LL << (b >> 1);
if (b & 1)
s += s >> 1;