]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR testsuite/36332 (FAIL: gcc.dg/torture/type-generic-1.c execution test on power...
authorJakub Jelinek <jakub@redhat.com>
Tue, 2 Sep 2008 18:46:29 +0000 (20:46 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 2 Sep 2008 18:46:29 +0000 (20:46 +0200)
PR target/36332
* real.c (real_maxval): Clear a lower bit to make real_maxval
match get_max_float for IBM long double format.

* gcc.c-torture/execute/ieee/pr36332.c: New test.

From-SVN: r139906

gcc/ChangeLog
gcc/real.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/ieee/pr36332.c [new file with mode: 0644]

index 0179e92f0d526636d0f6768e6d968d59ad484098..670d5f3ba5b24267d0ee1ec2d91389cbfc7600df 100644 (file)
@@ -1,3 +1,9 @@
+2008-09-02  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/36332
+       * real.c (real_maxval): Clear a lower bit to make real_maxval
+       match get_max_float for IBM long double format.
+
 2008-09-02  Andreas Schwab  <schwab@suse.de>
 
        * configure.ac: Use m4_quote to quote the expansion of m4_do.
index 886f8b4ae2c016c2ff1daaba7776c8592441844a..dc6d7483e998824e509e72953becec5c610e3de1 100644 (file)
@@ -2417,7 +2417,7 @@ real_maxval (REAL_VALUE_TYPE *r, int sign, enum machine_mode mode)
           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);
+       clear_significand_bit (r, SIGNIFICAND_BITS - fmt->pnan - 1);
     }
 }
 
index b30e34518d2313b268215744b7d20e3ef2a956dc..f9fdc55a00a2ca7b6174a2a8f656d2f02cdb6ad2 100644 (file)
@@ -1,5 +1,8 @@
 2008-09-02  Jakub Jelinek  <jakub@redhat.com>
 
+       PR target/36332
+       * gcc.c-torture/execute/ieee/pr36332.c: New test.
+
        PR c/37171
        * g++.dg/ext/attrib34.C: New test.
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/pr36332.c b/gcc/testsuite/gcc.c-torture/execute/ieee/pr36332.c
new file mode 100644 (file)
index 0000000..b22fd5d
--- /dev/null
@@ -0,0 +1,15 @@
+/* PR target/36332 */
+
+int __attribute__((noinline, used))
+foo (long double ld)
+{
+  return ld == __builtin_infl ();
+}
+
+int
+main ()
+{
+  if (foo (__LDBL_MAX__))
+    __builtin_abort ();
+  return 0;
+}