First Last Prev Next    No search results available
Details
: [llvmgcc] Incorrect parameter passing ABI when passing st...
Bug#: 609
: tools
: llvm-gcc
Status: RESOLVED
Resolution: FIXED
: Macintosh
: MacOS X
: 1.4
: P2
: normal
: 1.6

:
: miscompilation
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Chris Lattner <sabre@nondot.org>
Assigned To: Chris Lattner <sabre@nondot.org>

Attachments


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2005-07-27 16:42
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
------- Comment #1 From Chris Lattner 2005-07-28 13:53:48 -------
Fixed.  Patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050725/027274.html
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050725/027275.html

This fixes 252.eon, 168.wupwise, 178.galgel, and 301.apsi on Darwin.

-Chris

First Last Prev Next    No search results available