From fbda104d54cab15664e62b96b18b25bace34e2c1 Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 11 Sep 2015 20:56:05 +0000 Subject: [PATCH] * do not use a_call_ref for procedures allocating all registers since it break spilling, see also issue #28639, resolves issue #28639 git-svn-id: trunk@31608 - --- compiler/x86/nx86cal.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/x86/nx86cal.pas b/compiler/x86/nx86cal.pas index ed2a324b43..5288ad71fe 100644 --- a/compiler/x86/nx86cal.pas +++ b/compiler/x86/nx86cal.pas @@ -48,7 +48,7 @@ interface implementation uses - cgobj, + globtype,cgobj, cgbase,cpubase,cgx86,cga,aasmdata,aasmcpu, hlcgobj; @@ -88,7 +88,9 @@ implementation function tx86callnode.can_call_ref(var ref: treference): boolean; begin tcgx86(cg).make_simple_ref(current_asmdata.CurrAsmList,ref); - result:=true; + { do not use a ref. for calling conventions which allocate all registers, the reg. allocator cannot handle this, see + also issue #28639, I were not able to create a simple example though to cause the resulting endless spilling } + result:=not(procdefinition.proccalloption in [pocall_far16,pocall_pascal,pocall_oldfpccall]); end;