This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
MIPS cross compiler soft float problem
- From: Stefan Fagerström <stefan dot fagerstrom at kreatel dot se>
- To: "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 16 Jun 2003 10:14:34 +0200
- Subject: MIPS cross compiler soft float problem
Hi,
I have a stange problem with my cross compiler for mips.
It returns NaN when calling function with float arguments.
Example:
#include <stdio.h>
float a(float a, float b, float c, float d)
{
return a*b*c*d;
}
int main()
{
float b = a(1.0, 0.3, 0.4, 0.5);
printf("b = %f\n", b);
printf("mul 2.4*4.5 = %f\n", 2.4*4.5);
return 0;
}
Comipled with:
/usr/local/devenv/bin/mipsel-linux-gnu-gcc -o testfloatcall -O2 -mips2
-mcpu=r4600 -msoft-float -msoft-float testfloatcall.c
Results:
b = nan
mul 2.4*4.5 = 10.800000
The compiler is configured with:
Reading specs from
/usr/local/devenv/lib/gcc-lib/mipsel-linux-gnu/3.2.3/specs
Configured with: ../gcc-3.2.3/configure --target=mipsel-linux-gnu
--with-headers=/usr/local/devenv/mipsel-linux-gnu/sys-include
--enable-shared --enable-threads=posix --enable-long-long --disable-nls
--enable-multilib --with-gnu-as --with-gnu-ld --without-x
--enable-languages=c,c++ --prefix=/usr/local/devenv
Any ideas?
Regards,
Stefan Fagerström