[Bug optimization/11960] New: "can't find a register in class..." when using glibc 2.2.5 fmod() with -O2
alexander at malmberg dot org
gcc-bugzilla@gcc.gnu.org
Sun Aug 17 21:18:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11960
Summary: "can't find a register in class..." when using glibc
2.2.5 fmod() with -O2
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: alexander at malmberg dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
Using fmod() from glibc 2.2.5 with function calls as arguments gives the
following error when compiling with -O2:
test11_i.c:6: error: can't find a register in class `FP_TOP_REG' while reloading
`asm'
With -O0, it compiles ok. This is on objc-improvements-branch, but it doesn't
seem to be a branch-specific issue.
Preprocessed (and cleaned) source:
extern double fmod (double __x, double __y);
extern __inline double fmod (double __x, double __y)
{
register long double __value;
__asm __volatile__
("1: fprem\n\t" "fnstsw %%ax\n\t" "sahf\n\t" "jp 1b"
: "=t" (__value)
: "0" (__x), "u" (__y)
: "ax", "cc");
return __value; }
double quux(void);
int main(int argc,char **argv)
{
double d=fmod(quux(),quux());
return 0;
}
double quux(void)
{
return 1.2;
}
More information about the Gcc-bugs
mailing list