Explorar o código

* Tcgx86.g_concatcopy: optimization for the case where source.segment is
specified, but equal to DS in the current memory model

git-svn-id: trunk@27720 -

nickysn %!s(int64=11) %!d(string=hai) anos
pai
achega
6e7dd647fd
Modificáronse 1 ficheiros con 5 adicións e 3 borrados
  1. 5 3
      compiler/x86/cgx86.pas

+ 5 - 3
compiler/x86/cgx86.pas

@@ -2552,10 +2552,12 @@ unit cgx86;
                 list.concat(taicpu.op_reg(A_POP,push_segment_size,NR_ES));
               end;
             getcpuregister(list,REGSI);
-            if (source.segment=NR_NO) and
-               (segment_regs_equal(NR_SS,NR_DS) or ((source.base<>NR_BP) and (source.base<>NR_SP))) then
+            if ((source.segment=NR_NO) and (segment_regs_equal(NR_SS,NR_DS) or ((source.base<>NR_BP) and (source.base<>NR_SP)))) or
+               (is_segment_reg(source.segment) and segment_regs_equal(source.segment,NR_DS)) then
               begin
-                a_loadaddr_ref_reg(list,source,REGSI);
+                srcref:=source;
+                srcref.segment:=NR_NO;
+                a_loadaddr_ref_reg(list,srcref,REGSI);
                 saved_ds:=false;
               end
             else