Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix x86 CALLF #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix x86 CALLF #22

wants to merge 1 commit into from

Conversation

ksherlock
Copy link

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 foo
call foo
call foo

rather than

call foo
fstpl %st(0)
call foo
fstpl %st(0)
call foo
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant