From 6e7dd647fd9dc25d8dac618bce81c49eeb13bc8c Mon Sep 17 00:00:00 2001 From: nickysn Date: Fri, 2 May 2014 13:07:54 +0000 Subject: [PATCH] * 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 - --- compiler/x86/cgx86.pas | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/x86/cgx86.pas b/compiler/x86/cgx86.pas index ff8bfe6f6b..29f3e9e171 100644 --- a/compiler/x86/cgx86.pas +++ b/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