diff options
author | Roger Sayle <roger@eyesopen.com> | 2006-12-19 04:17:11 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2006-12-19 04:17:11 +0000 |
commit | f839548fc7279f813bebeca759f0a04dae5b4f62 (patch) | |
tree | e8a90d2006d130eb7cfc7fef2fb7db2523566785 | |
parent | a1e1a4515426eec96e372d8e4ff2cf19e21620e3 (diff) | |
download | gcc-f839548fc7279f813bebeca759f0a04dae5b4f62.zip gcc-f839548fc7279f813bebeca759f0a04dae5b4f62.tar.gz gcc-f839548fc7279f813bebeca759f0a04dae5b4f62.tar.bz2 |
re PR target/29302 (isfinite returns wrong result at -O1)
2006-12-18 Roger Sayle <roger@eyesopen.com>
Eric Christopher <echristo@apple.com>
PR target/29302
* real.c (real_maxval): Correctly handle IBM extended double format.
Co-Authored-By: Eric Christopher <echristo@apple.com>
From-SVN: r120040
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/real.c | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5e7bd5c..a76a75a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2006-12-18 Roger Sayle <roger@eyesopen.com> + Eric Christopher <echristo@apple.com> + + PR target/29302 + * real.c (real_maxval): Correctly handle IBM extended double format. + 2006-12-19 Jan Hubicka <jh@suse.cz> * expmed.c (expand_mult_const): Force operand to constant. @@ -2282,6 +2282,15 @@ real_maxval (REAL_VALUE_TYPE *r, int sign, enum machine_mode mode) np2 = SIGNIFICAND_BITS - fmt->p * fmt->log2_b; memset (r->sig, -1, SIGSZ * sizeof (unsigned long)); clear_significand_below (r, np2); + + if (fmt->pnan < fmt->p) + /* This is an IBM extended double format made up of two IEEE + doubles. The value of the long double is the sum of the + values of the two parts. The most significant part is + required to be the value of the long double rounded to the + nearest double. Rounding means we need a slightly smaller + value for LDBL_MAX. */ + clear_significand_bit (r, SIGNIFICAND_BITS - fmt->pnan); } } |