* doublest.c (convert_floatformat_to_doublest): Cast exp_bias to int.
authorDaniel Jacobowitz <drow@false.org>
Wed, 4 Dec 2002 05:40:40 +0000 (05:40 +0000)
committerDaniel Jacobowitz <drow@false.org>
Wed, 4 Dec 2002 05:40:40 +0000 (05:40 +0000)
* config/alpha/alpha-linux.mh (MH_CFLAGS): Add -mieee.

gdb/ChangeLog
gdb/config/alpha/alpha-linux.mh
gdb/doublest.c

index 01296116041bc3215196d21d10387844122858b8..92340b29ffebade04ec1c9e9085809f1e066e8bf 100644 (file)
@@ -1,3 +1,8 @@
+2002-12-04  Daniel Jacobowitz  <drow@mvista.com>
+
+       * doublest.c (convert_floatformat_to_doublest): Cast exp_bias to int.
+       * config/alpha/alpha-linux.mh (MH_CFLAGS): Add -mieee.
+
 2002-12-03  H.J. Lu  (hjl@gnu.org)
 
        * breakpoint.c (create_thread_event_breakpoint): Use xasprintf.
index 39f353201882a8b4776899cffc503938552651ba..7691d0729eb4c198f4452551eaf95224c90b3b80 100644 (file)
@@ -8,3 +8,7 @@ LOADLIBES = -ldl -rdynamic
 
 MMALLOC = 
 MMALLOC_CFLAGS = -DNO_MMALLOC 
+
+# doublest.c currently assumes some properties of FP arithmetic
+# on the host which require this.
+MH_CFLAGS = -mieee
index 6e96d78f0c0bc12ba519d458acd000497aed29b4..49e36899111418c7c9a23f1e2d622b84b537d921 100644 (file)
@@ -172,12 +172,14 @@ convert_floatformat_to_doublest (const struct floatformat *fmt,
 
   special_exponent = exponent == 0 || exponent == fmt->exp_nan;
 
-/* Don't bias NaNs. Use minimum exponent for denorms. For simplicity,
-   we don't check for zero as the exponent doesn't matter. */
+  /* Don't bias NaNs. Use minimum exponent for denorms. For simplicity,
+     we don't check for zero as the exponent doesn't matter.  Note the cast
+     to int; exp_bias is unsigned, so it's important to make sure the
+     operation is done in signed arithmetic.  */
   if (!special_exponent)
     exponent -= fmt->exp_bias;
   else if (exponent == 0)
-    exponent = 1 - fmt->exp_bias;
+    exponent = 1 - (int) fmt->exp_bias;
 
   /* Build the result algebraically.  Might go infinite, underflow, etc;
      who cares. */
This page took 0.032375 seconds and 4 git commands to generate.