Problem with -msoft-float on ARM4

Eric Thomas eric.thomas@ericsson.com
Thu Jun 17 12:26:00 GMT 1999


I'm using egcs-2.91.66 on the Netwinder ARM4 (SA-110) platform and have
verified this to also be a problem on egcs-2.95 061599 snapshot.

Here is a small test program that demonstrates part of the difficulity I
am
seeing.

--- begin example.c ---

#include <stdlib.h>

int main(int argc, char *argv[])
{
   long long ll_foo, ll_bar;
   double    d_foo;
  
   ll_foo = 56L;
   d_foo = (double)ll_foo;
   ll_bar = (long long)d_foo;   

   printf("ll_foo = %ld\n",ll_foo);
   printf("ll_bar = %ld\n",ll_bar);
}

--- end example.c ---

If I compile this using the NW's floating point emulator support, it
works correctly in that
ll_foo and ll_bar are both 56.  
# gcc example.c -o example

If I compile it to use libfloat, ll_bar is is zero.  
# gcc -msoft-float example.c -o example -lfloat

Basically the long long to double conversion generated by egcs does not
work properly
when using soft-float.  If any of the -O options are used, this test
program will
generate the proper output.  However, I have the same problem with a
larger-scale project.  
On the larger-scale project the problem exists regardless of the -O
options.  However, I 
have narrowed it down to a long long to double conversion.

Regards,
Eric Thomas
eric.thomas@ericsson.com


More information about the Gcc-bugs mailing list