Przeglądaj źródła

Fix make_simple_ref for pic address with big offsets

git-svn-id: trunk@23584 -
pierre 12 lat temu
rodzic
commit
2916235cfe
1 zmienionych plików z 4 dodań i 2 usunięć
  1. 4 2
      compiler/mips/cgcpu.pas

+ 4 - 2
compiler/mips/cgcpu.pas

@@ -326,7 +326,9 @@ begin
   begin
     tmpreg := cg.GetIntRegister(list, OS_INT);
     Load_PIC_Addr(list,tmpreg,ref);
-    { ref.symbol is nil now }
+    { ref.symbol is nil now, but we cannot reuse tmpreg below,
+      thus we need to reset it here, otherwise wrong code is generated }
+    tmpreg:=NR_NO;
   end;
   { When need to use LUI, do it first }
   if assigned(ref.symbol) or
@@ -2245,4 +2247,4 @@ end;
         cg64:=TCg64MPSel.Create;
       end;
 
-end.
+end.