Skip to content

x86 long double not passed according to the ABI #2159

@llvmbot

Description

@llvmbot
Bugzilla Link 1787
Resolution FIXED
Resolved on Nov 10, 2007 16:10
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor

Extended Description

If I pass two long doubles from a routine compiled with llvm-gcc to a routine
compiled with mainline gcc, then the second value is not passed right.

$ gcc -c ld_gcc.c
$ llvm-gcc -c ld_llvm.c
$ gcc -o x ld_llvm.o ld_gcc.o && ./x
1 0

If I recompile using only gcc, then all is well:
$ gcc -c ld_llvm.c
$ gcc -o x ld_llvm.o ld_gcc.o && ./x
1 1

First observed when calling the long double math library functions.

ld_gcc.c:

#include <stdio.h>
void p(long double d, long double e) {
printf("%g %g\n", (double)d, (double)e);
}

ld_llvm.c:

extern void p(long double, long double);
int main(void) {
p(1.0, 1.0);
return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions