Open ksherlock opened 9 years ago
Reported in comp.compilers.lcc on 3/3/2013. (news:cff50e0c-3bb4-4456-ba98-1641eeacd772@googlegroups.com)
comp.compilers.lcc
On compiling expression statements like foo(); foo(); foo(); where foo is declared as double foo(void); the compiler generates call foo call foo call foo rather than call foo fstpl %st(0) call foo fstpl %st(0) call foo fstpl %st(0)
On compiling expression statements like
foo(); foo(); foo();
where foo is declared as
double foo(void);
the compiler generates
call foo call foo call foo
call foo
rather than
call foo fstpl %st(0) call foo fstpl %st(0) call foo fstpl %st(0)
fstpl %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.
reg: CALLF
stmt: CALLF
Reported in
comp.compilers.lcc
on 3/3/2013. (news:cff50e0c-3bb4-4456-ba98-1641eeacd772@googlegroups.com)The underlying issue is that the
reg: CALLF
(which doesn't clean up the x87 stack) is preferred over thestmt: CALLF
(which does clean up the stack). Re-ordering thestmt: CALLF
first fixes the problem.