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

ppc linux doesn't handle float parameter to varargs function #1436

Closed
nlewycky opened this issue Dec 22, 2006 · 1 comment
Closed

ppc linux doesn't handle float parameter to varargs function #1436

nlewycky opened this issue Dec 22, 2006 · 1 comment
Labels

Comments

@nlewycky
Copy link
Contributor

Bugzilla Link 1064
Resolution FIXED
Resolved on Feb 22, 2010 12:43
Version trunk
OS Linux

Extended Description

The Linux ABI requires that you set control register 6 before calling a variadic
function with a float parameter. Similarly, it recommends that you clear it
before calling a variadic function without one.

A simple example is:

#include <stdio.h>
int main(void) {
printf("%f\n", 1.2);
return 0;
}

which will print "0.0" on PPC Linux. In the assembly, right before "bl printf",
add "creqv 6,6,6" and it will work properly. This fix will require changes to
the PPCISelLowering.cpp:LowerCALL function.

@nlewycky
Copy link
Contributor Author

nlewycky commented Mar 3, 2007

This works now, presumably through the many Linux/PPC patches by Nicolas Geoffray.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant