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 libgcc/78804] New: [RX] -m64bit-doubles does not work


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

            Bug ID: 78804
           Summary: [RX] -m64bit-doubles does not work
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: olegendo at gcc dot gnu.org
  Target Milestone: ---

The following program 

#include <stdio.h>
#include <stdint.h>

int main (void)
{
    volatile double testval = 1.0;
    printf ("testval = %02x%02x%02x%02x%02x%02x%02x%02x\n",
            ((const uint8_t*)&testval)[0], ((const uint8_t*)&testval)[1],
            ((const uint8_t*)&testval)[2], ((const uint8_t*)&testval)[3],
            ((const uint8_t*)&testval)[4], ((const uint8_t*)&testval)[5],
            ((const uint8_t*)&testval)[6], ((const uint8_t*)&testval)[7]);

    volatile int testval_i = (int)testval;
    printf ("testval_i =  %d\n", testval_i);

  return 0;
}

normally prints 

testval = 000000000000f03f
testval_i =  1

when compiling with e.g.
rx-elf-gcc -O2 -m64bit-doubles -msim test.cpp

and running with rx-elf-run, it will print

testval = 000000000000f03f
testval_i =  0

which is wrong.

Same happens also on real hardware.  Maybe I'm missing some configure options
or some other prerequisite for soft-fp on RX.  However, I think this should be
working out-of-the-box.

rx-elf-gcc -v
Using built-in specs.
COLLECT_GCC=rx-elf-gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/rx-elf/6.2.1/lto-wrapper
Target: rx-elf
Configured with: ../gcc6/configure --target=rx-elf --prefix=/usr/local
--enable-languages=c,c++ --disable-nls --disable-werror --with-newlib
--enable-lto --enable-multilib --with-system-zlib --disable-libstdcxx-verbose
--disable-symvers
Thread model: single
gcc version 6.2.1 20161127 (GCC) 

newlib was configured with:
--target=rx-elf --prefix=/usr/local --enable-lto --enable-multilib
--disable-newlib-supplied-syscalls --enable-newlib-io-c99-formats
--enable-newlib-io-long-long

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