i386-mingw32-gcc can't find register in class FP_TOP_REG
Bernd Jendrissek
berndj@prism.co.za
Tue May 13 19:55:00 GMT 2003
Hi
I have a compiler error at -O2 that goes away at -O0:
/mnt/disk2/src/mingw/mingw-runtime-3.0/mingwex: PATH=/usr/cross/bin:$PATH i386-mingw32-gcc -c -g -O2 -fomit-frame-pointer -I ./../../w32api/include -I. -I./../include -nostdinc -nostdinc++ -iwithprefixbefore include -da ./math/pow.c -o pow.o
math/pow.c: In function `pow':
../include/math.h:174: error: can't find a register in class `FP_TOP_REG' while reloading `asm'
Here's that part of the header:
#if !defined (__NO_INLINES__)
extern __inline__ __cdecl double fabs (double x)
{
double res;
__asm__ ("fabs;" : "=t" (res) : "0" (x));
return res;
}
#endif
/usr/src/home: cat /mnt/disk2/src/gcc/LAST_UPDATED
Tue May 13 17:39:22 SAST 2003
Tue May 13 15:39:22 UTC 2003
Unfortunately I don't know what do do with all those -da output files.
But I do have a testcase derived from the mingw-runtime and w32-api sources
(attached).
--
bernd.jendrissek@mailbox.co.za is probably better to bookmark than any
employer-specific email address I may have appearing in the headers.
-------------- next part --------------
/* Run like so:
/usr/cross/bin/i386-mingw32-gcc -c -O2 -Wall powcrash.c -o powcrash.o
*/
# ifndef _CRTIMP
# define _CRTIMP __declspec(dllimport)
# endif
# ifndef __cdecl
# define __cdecl __attribute__((cdecl))
# endif
_CRTIMP double __cdecl floor (double);
_CRTIMP double __cdecl fabs (double);
extern __inline__ __cdecl double fabs (double x)
{
double res;
__asm__ ("fabs;" : "=t" (res) : "0" (x));
return res;
}
double pow(double x, double y)
{
double ya;
double yb;
int yoddint;
yoddint = 0;
/* Test for odd integer y. */
ya = floor(0.5);
yb = 0.5 * fabs(0.0);
if( ya != yb )
yoddint = 1;
if( y < 0.0 ) {
if( yoddint )
return( 0.0 );
}
return( 0.0 );
}
More information about the Gcc
mailing list