[llvmgcc] Incorrect parameter passing ABI when passing structs with FP elements by value #981
Labels
bugzilla
Issues migrated from bugzilla
llvm-tools
All llvm tools that do not have corresponding tag
miscompilation
Extended Description
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
The text was updated successfully, but these errors were encountered: