patch for execute/920501-6.c
Joern Rennecke
amylaar@cygnus.co.uk
Thu Oct 16 16:08:00 GMT 1997
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;
More information about the Gcc
mailing list