RFA (mmix): FIx PR46739

Joseph S. Myers joseph@codesourcery.com
Mon Dec 6 17:21:00 GMT 2010


I don't think the code is correct either before or after this patch; 
aren't the halves of a CONST_DOUBLE in units of HOST_WIDE_INT not long?  
The whole block

  /* We make a little song and dance because converting to long long in
     gcc-2.7.2 is broken.  I still want people to be able to use it for
     cross-compilation to MMIX.  */
  if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) == VOIDmode)
    {
      if (sizeof (HOST_WIDE_INT) < sizeof (HOST_WIDEST_INT))
        {
          retval = (unsigned) CONST_DOUBLE_LOW (x) / 2;
          retval *= 2;
          retval |= CONST_DOUBLE_LOW (x) & 1;

          retval |=
            (unsigned HOST_WIDEST_INT) CONST_DOUBLE_HIGH (x)
              << (HOST_BITS_PER_LONG);
        }
      else
        retval = CONST_DOUBLE_HIGH (x);

      return retval;
    }

should be substantially simplified given that 2.95 not 2.7.2 is the 
minimum version for building a cross compiler.  (Maybe double-int.[ch] 
should have functions to convert a double_int value to either signed or 
unsigned HOST_WIDEST_INT.)

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list