diff options
author | Daniel Jacobowitz <drow@false.org> | 2002-12-04 05:40:40 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2002-12-04 05:40:40 +0000 |
commit | 38c52d5ab7af33477c588c45554bb84f6c6ac4df (patch) | |
tree | 883d3cc08f85abf87c2194b0775931716c8b8be8 | |
parent | d8ef46f5faa8a4d71f626d08a6a28359435bce6b (diff) | |
download | gdb-38c52d5ab7af33477c588c45554bb84f6c6ac4df.zip gdb-38c52d5ab7af33477c588c45554bb84f6c6ac4df.tar.gz gdb-38c52d5ab7af33477c588c45554bb84f6c6ac4df.tar.bz2 |
* doublest.c (convert_floatformat_to_doublest): Cast exp_bias to int.
* config/alpha/alpha-linux.mh (MH_CFLAGS): Add -mieee.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/config/alpha/alpha-linux.mh | 4 | ||||
-rw-r--r-- | gdb/doublest.c | 8 |
3 files changed, 14 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0129611..92340b2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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. diff --git a/gdb/config/alpha/alpha-linux.mh b/gdb/config/alpha/alpha-linux.mh index 39f3532..7691d07 100644 --- a/gdb/config/alpha/alpha-linux.mh +++ b/gdb/config/alpha/alpha-linux.mh @@ -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 diff --git a/gdb/doublest.c b/gdb/doublest.c index 6e96d78..49e3689 100644 --- a/gdb/doublest.c +++ b/gdb/doublest.c @@ -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. */ |