[LLVMbugs] [Bug 609] NEW: [llvmgcc] Incorrect parameter passing ABI when passing structs with FP elements by value

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Jul 27 14:42:32 PDT 2005


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=609

           Summary: [llvmgcc] Incorrect parameter passing ABI when passing
                    structs with FP elements by value
           Product: tools
           Version: 1.4
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llvm-gcc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sabre at nondot.org


llvm-gcc currently miscompiles this on darwin:

typedef struct {
  double re,im;
} DComplex;
void bar(DComplex *P, void (*FP)(DComplex)) {
  FP(*P, *P);
}

The prototype it emits for "FP" is:

void (double, double)* %FP

Unfortunately, darwin requires structs to be passed in integer regs regardless of whether the incoming 
values are FP or not.  This means the prototype should be:

void (long, long)* %FP

or 

void (int, int, int, int)* %FP

... yuck.

-Chris



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