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]

RFA: fix avoid random results from do_add


I had a ENABLE_CHECKING ICE because two identical floating point constants
didn't hash to the same value.

2004-06-03  J"orn Rennecke <joern.rennecke@superh.com>

	* real.c (do_add): Initialize r->signalling and r->canonical.

Index: real.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/real.c,v
retrieving revision 1.141
diff -p -r1.141 real.c
*** real.c	22 Mar 2004 00:40:44 -0000	1.141
--- real.c	4 Jun 2004 13:30:05 -0000
*************** do_add (REAL_VALUE_TYPE *r, const REAL_V
*** 580,585 ****
--- 580,591 ----
        abort ();
      }
  
+   /* Make sure all fields in the result are initialized.
+      This is needed so that tree hashing produces consistent results.
+      We can't use get_zero here because A or B might be equal to R.  */
+   r->signalling = 0;
+   r->canonical = 0;
+ 
    /* Swap the arguments such that A has the larger exponent.  */
    dexp = REAL_EXP (a) - REAL_EXP (b);
    if (dexp < 0)


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