lcc
lcc copied to clipboard
fix x86 CALLF
Reported in comp.compilers.lcc on 3/3/2013. (news:[email protected])
On compiling expression statements like
foo(); foo(); foo();where foo is declared as
double foo(void);the compiler generates
call foocall foocall foorather than
call foofstpl %st(0)call foofstpl %st(0)call foofstpl %st(0)
The underlying issue is that the reg: CALLF (which doesn't clean up the x87 stack) is preferred over the stmt: CALLF (which does clean up the stack). Re-ordering the stmt: CALLF first fixes the problem.