public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/95450] New: [10 regression] Wrong long double folding
@ 2020-05-31 12:51 schwab@linux-m68k.org
  2020-06-02  7:32 ` [Bug target/95450] [10/11 " rguenth at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: schwab@linux-m68k.org @ 2020-05-31 12:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95450

            Bug ID: 95450
           Summary: [10 regression] Wrong long double folding
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: schwab@linux-m68k.org
  Target Milestone: ---
            Target: powerpc-*.*

$ cat test-float.c
#include <float.h>
#include <assert.h>

union gl_long_double_union
  {
    struct { double hi; double lo; } dd;
    long double ld;
  };

const union gl_long_double_union gl_LDBL_MAX =
  { { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
# undef LDBL_MAX
# define LDBL_MAX (gl_LDBL_MAX.ld)

int
main ()
{
  volatile long double m = LDBL_MAX;

  assert (m + m > m);
}
$ gcc -O2 test-float.c
$ ./a.out
a.out: test-float.c:20: main: Assertion `m + m > m' failed.
Aborted

test-float.c.234t.optimized contains:

  m ={v} 1.79769313486231580793728971405302307166001572487e+308;

but that evaluates to Inf.  DBL_MAX is
1.79769313486231570814527423731704e+308L.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-08-25 18:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-31 12:51 [Bug target/95450] New: [10 regression] Wrong long double folding schwab@linux-m68k.org
2020-06-02  7:32 ` [Bug target/95450] [10/11 " rguenth at gcc dot gnu.org
2020-06-02  8:34 ` schwab@linux-m68k.org
2020-07-23  6:51 ` rguenth at gcc dot gnu.org
2020-08-11 16:14 ` carlos at redhat dot com
2020-08-11 16:17 ` mpolacek at gcc dot gnu.org
2020-08-11 16:19 ` jakub at gcc dot gnu.org
2020-08-11 16:46 ` jakub at gcc dot gnu.org
2020-08-11 16:54 ` jakub at gcc dot gnu.org
2020-08-11 17:26 ` jakub at gcc dot gnu.org
2020-08-25  5:18 ` cvs-commit at gcc dot gnu.org
2020-08-25 17:45 ` cvs-commit at gcc dot gnu.org
2020-08-25 18:25 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).