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

--- Comment #5 from Oleg Endo <olegendo at gcc dot gnu.org> ---
I have checked with the following simplified test code:

#include <stdint.h>

int main (void)
{
  volatile float testval = 1;
//  volatile double testval = 1;
  testval = testval + 1;

  return ((const uint8_t*)&testval)[ sizeof (testval) - 1] == 0x40;
}


This makes it easier to disassemble.  Normally, for float and for double the
program should return 1.

When compiling for RX100 (-mcpu=rx100), all the floating point calculations are
done by soft-fp, because there is no hardware support.  So it's easier to
compare both programs than in RX600.  Even then, the float variant is OK, but
the double variant still fails.

The actual addition is done by the function __fpadd_parts in both cases.
The difference of SF and DF is in ___unpack_d, ___pack_d and ___unpack_f,
___pack_f.  The code of those *_f and *_d functions looks different, so I
assume that the *_d versions are not compiled wrongly as SF.

It must be some wrong code around there.

Reply via email to