"asm needs too many reloads" new since 1.0.3a (1.1?)

Zack Weinberg zack@rabi.columbia.edu
Fri Sep 11 13:52:00 GMT 1998


The current CVS egcs will not compile the appended test case.  I get:

$ ~/glibc/bin/gcc -v -O2 -march=pentium -mcpu=pentium \
	-momit-leaf-frame-pointer -S test.i
Reading specs from .../glibc/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.92.04/specs
gcc version egcs-2.92.04 19980910 (gcc2 ss-980609 experimental)
 .../glibc/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.92.04/cc1 test.i \
	-quiet -march=pentium -mcpu=pentium -momit-leaf-frame-pointer \
	-O2 -version -o test.s
GNU C version egcs-2.92.04 19980910 (gcc2 ss-980609 experimental) 
(i586-pc-linux-gnu) compiled by GNU C version egcs-2.92.04 19980910
(gcc2 ss-980609 experimental).
test.i: In function `atan2_test':
test.i:7: `asm' needs too many reloads

The same code compiles fine with egcs 1.0.3a and I think with 1.1
also.

Incidentally, if I disable inlining then it compiles fine but the
generated assembly is suboptimal and possibly incorrect.  I don't
know x86 asm well enough to say for sure.

zw

-- test.i --
extern void check (const char *, double, double);

inline double 
atan2 (double y, double x)
{
  register long double value;
  asm volatile ("fpatan" : "=t" (value) : "0" (x), "u" (y) : "st(1)");
  return value;
}

void
atan2_test (void)
{
  check ("atan2 (0, x) == 0 for x > 0", atan2 (0, 12.04), 0);
}



More information about the Gcc-bugs mailing list