浏览代码

Add pi_needs_got to current_procinfo.flags in pass_1 method if a label reference is used

git-svn-id: trunk@22448 -
pierre 13 年之前
父节点
当前提交
bc04e83b25
共有 2 个文件被更改,包括 11 次插入1 次删除
  1. 9 1
      compiler/ncon.pas
  2. 2 0
      compiler/nmem.pas

+ 9 - 1
compiler/ncon.pas

@@ -203,7 +203,7 @@ implementation
     uses
     uses
       cutils,
       cutils,
       verbose,systems,sysutils,
       verbose,systems,sysutils,
-      defutil,
+      defutil,procinfo,
       cpubase,cgbase,
       cpubase,cgbase,
       nld;
       nld;
 
 
@@ -588,6 +588,8 @@ implementation
       begin
       begin
          result:=nil;
          result:=nil;
          expectloc:=LOC_CREFERENCE;
          expectloc:=LOC_CREFERENCE;
+         if (cs_create_pic in current_settings.moduleswitches) then
+           include(current_procinfo.flags,pi_needs_got);
       end;
       end;
 
 
     function trealconstnode.docompare(p: tnode): boolean;
     function trealconstnode.docompare(p: tnode): boolean;
@@ -948,6 +950,9 @@ implementation
           end
           end
         else
         else
           expectloc:=LOC_CREFERENCE;
           expectloc:=LOC_CREFERENCE;
+        if (cs_create_pic in current_settings.moduleswitches) and
+           (expectloc <> LOC_CONSTANT) then
+          include(current_procinfo.flags,pi_needs_got);
       end;
       end;
 
 
 
 
@@ -1227,6 +1232,9 @@ implementation
           expectloc:=LOC_CONSTANT
           expectloc:=LOC_CONSTANT
          else
          else
           expectloc:=LOC_CREFERENCE;
           expectloc:=LOC_CREFERENCE;
+        if (cs_create_pic in current_settings.moduleswitches) and
+           (expectloc <> LOC_CONSTANT) then
+          include(current_procinfo.flags,pi_needs_got);
       end;
       end;
 
 
 
 

+ 2 - 0
compiler/nmem.pas

@@ -219,6 +219,8 @@ implementation
       begin
       begin
          result:=nil;
          result:=nil;
          expectloc:=LOC_REGISTER;
          expectloc:=LOC_REGISTER;
+         if (cs_create_pic in current_settings.moduleswitches) then
+           include(current_procinfo.flags,pi_needs_got);
          if left.nodetype<>typen then
          if left.nodetype<>typen then
            begin
            begin
              if is_objcclass(left.resultdef) and
              if is_objcclass(left.resultdef) and