From bc04e83b2514ed9fd1551dee6912e37384a4137d Mon Sep 17 00:00:00 2001 From: pierre Date: Mon, 24 Sep 2012 15:39:26 +0000 Subject: [PATCH] Add pi_needs_got to current_procinfo.flags in pass_1 method if a label reference is used git-svn-id: trunk@22448 - --- compiler/ncon.pas | 10 +++++++++- compiler/nmem.pas | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/compiler/ncon.pas b/compiler/ncon.pas index 8154329298..84df2d09b2 100644 --- a/compiler/ncon.pas +++ b/compiler/ncon.pas @@ -203,7 +203,7 @@ implementation uses cutils, verbose,systems,sysutils, - defutil, + defutil,procinfo, cpubase,cgbase, nld; @@ -588,6 +588,8 @@ implementation begin result:=nil; expectloc:=LOC_CREFERENCE; + if (cs_create_pic in current_settings.moduleswitches) then + include(current_procinfo.flags,pi_needs_got); end; function trealconstnode.docompare(p: tnode): boolean; @@ -948,6 +950,9 @@ implementation end else expectloc:=LOC_CREFERENCE; + if (cs_create_pic in current_settings.moduleswitches) and + (expectloc <> LOC_CONSTANT) then + include(current_procinfo.flags,pi_needs_got); end; @@ -1227,6 +1232,9 @@ implementation expectloc:=LOC_CONSTANT else expectloc:=LOC_CREFERENCE; + if (cs_create_pic in current_settings.moduleswitches) and + (expectloc <> LOC_CONSTANT) then + include(current_procinfo.flags,pi_needs_got); end; diff --git a/compiler/nmem.pas b/compiler/nmem.pas index dec4917143..3ee772eb7c 100644 --- a/compiler/nmem.pas +++ b/compiler/nmem.pas @@ -219,6 +219,8 @@ implementation begin result:=nil; expectloc:=LOC_REGISTER; + if (cs_create_pic in current_settings.moduleswitches) then + include(current_procinfo.flags,pi_needs_got); if left.nodetype<>typen then begin if is_objcclass(left.resultdef) and