This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

patch for execute/920501-6.c


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]