Fix ieee float decoding

Andreas Schwab schwab@suse.de
Tue Apr 1 19:50:00 GMT 2003


This fixes a bug in the ieee float decoder.  The image has been shifted up
by HOST_BITS_PER_LONG - 24, so that the SNaN bit is now at position
HOST_BITS_PER_LONG - 2.  Regtested on ia64-linux (there are some new
failures due to an ICE in reg_overlap_mentioned_p, more about that later).

Andreas.

2003-04-01  Andreas Schwab  <schwab@suse.de>

	* real.c (decode_ieee_single): Fix decoding of SNaN bit.

--- gcc/real.c.~1.114.~	2003-04-01 09:25:43.000000000 +0200
+++ gcc/real.c	2003-04-01 09:27:16.000000000 +0200
@@ -2687,7 +2687,8 @@ decode_ieee_single (fmt, r, buf)
 	{
 	  r->class = rvc_nan;
 	  r->sign = sign;
-	  r->signalling = ((image >> 22) & 1) ^ fmt->qnan_msb_set;
+	  r->signalling = (((image >> (HOST_BITS_PER_LONG - 2)) & 1)
+			   ^ fmt->qnan_msb_set);
 	  r->sig[SIGSZ-1] = image;
 	}
       else

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Gcc-patches mailing list