From b9138a1c904c4b25ee76dfa6ee1acd26c14f944a Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sat, 25 Apr 2015 15:51:27 +0000 Subject: [PATCH] * changed the llvm type of comp/currency in parameter and return type on platforms that use the x87 for these types to extended in order to gaurantee the expected parameter passing conventions git-svn-id: trunk@30719 - --- compiler/llvm/llvmdef.pas | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compiler/llvm/llvmdef.pas b/compiler/llvm/llvmdef.pas index 14b5765c58..42507c5e7b 100644 --- a/compiler/llvm/llvmdef.pas +++ b/compiler/llvm/llvmdef.pas @@ -764,6 +764,14 @@ implementation usedef:=cgpara.location^.def; if beforevalueext then llvmextractvalueextinfo(cgpara.def,usedef,valueext); + { comp and currency are handled by the x87 in this case. They cannot + be represented directly in llvm, and llvmdef translates them into + i64 (since that's their storage size and internally they also are + int64). Solve this by changing the type to s80real in the + returndef/parameter declaration. } + if (usedef.typ=floatdef) and + (tfloatdef(usedef).floattype in [s64comp,s64currency]) then + usedef:=s80floattype; result:=usedef; exit end;