소스 검색

* ARM: Fixed GOT init when optimization is off.

git-svn-id: trunk@31728 -
yury 10 년 전
부모
커밋
1dff9bf025
1개의 변경된 파일8개의 추가작업 그리고 13개의 파일을 삭제
  1. 8 13
      compiler/arm/cgcpu.pas

+ 8 - 13
compiler/arm/cgcpu.pas

@@ -2355,19 +2355,14 @@ unit cgcpu;
             current_asmdata.getaddrlabel(l);
             current_procinfo.aktlocaldata.concat(tai_const.Create_rel_sym_offset(aitconst_32bit,l,current_asmdata.RefAsmSymbol('_GLOBAL_OFFSET_TABLE_'),-8));
             cg.a_label(list,l);
-            if cs_opt_regvar in current_settings.optimizerswitches then
-              begin
-                {
-                  When regvars are used, it is needed to perform GOT calculations using the scratch register R12
-                  and then MOV the result to the GOT register. Otherwise the register allocator will use
-                  register R0 as temp to perform calculations in case if a procedure uses all available registers.
-                  It leads to corruption of R0 which is normally holds a value of the first procedure parameter.
-                }
-                list.concat(Taicpu.op_reg_reg_reg(A_ADD,NR_R12,NR_PC,NR_R12));
-                list.concat(Taicpu.op_reg_reg(A_MOV,current_procinfo.got,NR_R12));
-              end
-            else
-              list.concat(Taicpu.op_reg_reg_reg(A_ADD,current_procinfo.got,NR_PC,NR_R12));
+            {
+              It is needed to perform GOT calculations using the scratch register R12
+              and then MOV the result to the GOT register. Otherwise the register allocator will use
+              register R0 as temp to perform calculations in case if a procedure uses all available registers.
+              It leads to corruption of R0 which is normally holds a value of the first procedure parameter.
+            }
+            list.concat(Taicpu.op_reg_reg_reg(A_ADD,NR_R12,NR_PC,NR_R12));
+            list.concat(Taicpu.op_reg_reg(A_MOV,current_procinfo.got,NR_R12));
             a_reg_dealloc(list,NR_R12);
           end;
       end;