http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54347

             Bug #: 54347
           Summary: REAL_VALUE_TO_TARGET_LONG_DOUBLE shouldn't be used in
                    i386
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: hjl.to...@gmail.com
                CC: ubiz...@gmail.com


i386.c has

  /* The __float80 type.  */
  float80_type_node = long_double_type_node;
  if (TYPE_MODE (float80_type_node) != XFmode)
    {
      /* The __float80 type.  */
      float80_type_node = make_node (REAL_TYPE);

      TYPE_PRECISION (float80_type_node) = 80;
      layout_type (float80_type_node);
    }
  lang_hooks.types.register_builtin_type (float80_type_node, "__float80");

and

i386-interix.h:#undef LONG_DOUBLE_TYPE_SIZE
i386-interix.h:#define LONG_DOUBLE_TYPE_SIZE 64

long double may not be 80-bit.  But i386.c has

               case XFmode:
                  REAL_VALUE_TO_TARGET_LONG_DOUBLE (r, l);
                  parts[2] = gen_int_mode (l[2], SImode);
                  break;

It assumes long double is in XFmode.  It should simply use

real_to_target (l, &r, mode);

instead of

REAL_VALUE_TO_TARGET_LONG_DOUBLE (r, l);

Reply via email to