This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: fix bootstrap comparison failures


On Wed, Sep 18, 2002 at 02:38:50PM -0700, Richard Henderson wrote:
> When starting from gcc 2.96 (or some other non-recent or non-gcc), we
> don't have a C99 compliant boolean.  What we've got is regular integral
> type typedefed to bool.  Which means that any time we rely on the
> properties of a C99 boolean, we're wrong.

Here's another one, found by inspection.


r~


        * real.c (round_for_format): Collect sticky as unsigned long, not bool.

Index: real.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/real.c,v
retrieving revision 1.85
diff -c -p -d -r1.85 real.c
*** real.c	18 Sep 2002 21:23:24 -0000	1.85
--- real.c	19 Sep 2002 00:04:23 -0000
*************** round_for_format (fmt, r)
*** 2121,2127 ****
       struct real_value *r;
  {
    int p2, np2, i, w;
!   bool sticky, guard, lsb;
    int emin2m1, emax2;
  
    p2 = fmt->p * fmt->log2_b;
--- 2121,2128 ----
       struct real_value *r;
  {
    int p2, np2, i, w;
!   unsigned long sticky;
!   bool guard, lsb;
    int emin2m1, emax2;
  
    p2 = fmt->p * fmt->log2_b;
*************** round_for_format (fmt, r)
*** 2207,2214 ****
  
    sticky = 0;
    for (i = 0, w = (np2 - 1) / HOST_BITS_PER_LONG; i < w; ++i)
!     if (r->sig[i])
!       sticky = 1;
    sticky |=
      r->sig[w] & (((unsigned long)1 << ((np2 - 1) % HOST_BITS_PER_LONG)) - 1);
  
--- 2208,2214 ----
  
    sticky = 0;
    for (i = 0, w = (np2 - 1) / HOST_BITS_PER_LONG; i < w; ++i)
!     sticky |= r->sig[i];
    sticky |=
      r->sig[w] & (((unsigned long)1 << ((np2 - 1) % HOST_BITS_PER_LONG)) - 1);
  


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