view ldc-posix-tango @ 1410:cc2d8a7388c7

Count the sret register as well when keeping track of how many integer registers are available for extern(C) functions on x86-64. Interestingly, llvm-g++ seems to have a very similar bug: http://llvm.org/pr4242 (So this breaks ABI-compatibility with llvm-gcc for this corner case, but gains it with gcc...) To clarify, this is about code like this: {{{ struct S { void*[3] data; } struct T { void*[2] data; } // The T should be passed in memory, and p in the last int register. extern(C) S fail(int, int, int, int, T t, void* p) { S s; s.data[0] = t.data[0]; s.data[1] = t.data[1]; s.data[2] = p; return s; } }}} which should generate code functionally equivalent to this: {{{ extern(C) S* succeed(S* s, int, int, int, int, T t, void* p) { s.data[0] = t.data[0]; s.data[1] = t.data[1]; s.data[2] = p; return s; } }}} (with the same definitions for S and T)
author Frits van Bommel <fvbommel wxs.nl>
date Fri, 22 May 2009 13:17:06 +0200
parents 8403fec8c34c
children
line wrap: on
line source

ignore=object

compiler=ldc
inifile=ldc.rebuild.conf

exeext=
objext=o


version=LLVM
version=LDC
noversion=DigitalMars
noversion=GNU
testversion=linux
testversion=darwin
testversion=freebsd
testversion=Unix
testversion=Posix
testversion=Windows
testversion=Win32
testversion=Win64
testversion=mingw32
testversion=X86
testversion=PPC
testversion=X86_64
testversion=PPC64
testversion=D_InlineAsm
testversion=D_InlineAsm_X86
testversion=D_InlineAsm_PPC
testversion=D_InlineAsm_X86_64
testversion=D_InlineAsm_PPC64
testversion=LLVM_InlineAsm_X86
testversion=LittleEndian
testversion=BigEndian
testversion=LLVM64
testversion=PIC
testversion=Tango


[compile]
oneatatime=yes
cmd=ldmd -c $i

flag=$i
incdir=-I$i
libdir=-L-L$i
optimize=-O3
version=-version=$i


[link]
oneatatime=yes
cmd=ldc $i -of$o

libdir=-L-L$i
lib=-L-l$i
flag=-L$i


[liblink]
safe=yes
oneatatime=yes
cmd=ar rc $o $i

libdir=
lib=
flag=


[postliblink]
cmd=ranlib $i


[shliblink]
shlibs=no

[dyliblink]
dylibs=no