From 3a464dbdcf9175ef3ce50a51274ed159041bcec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Balogh?= Date: Wed, 12 Mar 2014 02:34:30 +0000 Subject: [PATCH] don't swap the base and index registers if we have a scalefactor git-svn-id: trunk@27109 - --- compiler/m68k/cgcpu.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/m68k/cgcpu.pas b/compiler/m68k/cgcpu.pas index bd201d5232..6f87428b6f 100644 --- a/compiler/m68k/cgcpu.pas +++ b/compiler/m68k/cgcpu.pas @@ -453,10 +453,12 @@ unit cgcpu; } { first ensure that base is an address register } if ((ref.base<>NR_NO) and (ref.index<>NR_NO)) and - (not isaddressregister(ref.base) and isaddressregister(ref.index)) then + (not isaddressregister(ref.base) and isaddressregister(ref.index)) and + (ref.scalefactor < 2) then begin { if we have both base and index registers, but base is data and index - is address, we can just swap them, as FPC always uses long index } + is address, we can just swap them, as FPC always uses long index. + but we can only do this, if the index has no scalefactor } hreg:=ref.base; ref.base:=ref.index; ref.index:=hreg;