[LLVMbugs] [Bug 1064] NEW: ppc linux doesn't handle float parameter to varargs function

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Dec 22 08:27:07 PST 2006


http://llvm.org/bugs/show_bug.cgi?id=1064

           Summary: ppc linux doesn't handle float parameter to varargs
                    function
           Product: libraries
           Version: trunk
          Platform: Macintosh
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Backend: PowerPC
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nicholas at mxc.ca


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.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the llvm-bugs mailing list