This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/70117] New: ppc long double isinf() is wrong?


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

            Bug ID: 70117
           Summary: ppc long double isinf() is wrong?
           Product: gcc
           Version: 5.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
                CC: meissner at gcc dot gnu.org
  Target Milestone: ---

Appearantly gnulib has its own idea of LDBL_MAX and with recent glibc changing
isinf to use GCC builtins we end up with the following failing test which
may be because GCC folds the isinf() call to do effectively

if (islessequal (fabsl (gl_LDBL_MAX.ld),
1.79769313486231580793728971405301199252069012264752390332e+308))

which may or may not be valid for IBM long double (double double) which is
said to have "many" LDBL_MAX?


#include <float.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 } };

int main()
{
  if (__builtin_isinfl (gl_LDBL_MAX.ld))
    __builtin_abort ();
  if (__builtin_isinfl (-gl_LDBL_MAX.ld))
    __builtin_abort ();
  return 0;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]