From 8a7c16327cba94d02c8ba8eff4f4e1b5579b682f Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 31 Aug 2014 18:00:10 +0000 Subject: [PATCH] * fixes reference handling for arm thumb and ldrh, not perfect yet git-svn-id: trunk@28568 - --- compiler/arm/cgcpu.pas | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/compiler/arm/cgcpu.pas b/compiler/arm/cgcpu.pas index e1e297b595..2697848262 100644 --- a/compiler/arm/cgcpu.pas +++ b/compiler/arm/cgcpu.pas @@ -4074,8 +4074,19 @@ unit cgcpu; ((op=A_LDRB) and (oppostfix=PF_None))) and ((ref.base=NR_STACK_POINTER_REG) or (ref.index=NR_STACK_POINTER_REG) or - (abs(ref.offset)>31)) - ) then + (abs(ref.offset)>31) + ) + ) or + { LDRH limitations } + ( + (((op=A_LDR) and (oppostfix=PF_H)) or + ((op=A_LDRH) and (oppostfix=PF_None))) and + ((ref.base=NR_STACK_POINTER_REG) or + (ref.index=NR_STACK_POINTER_REG) or + (abs(ref.offset)>62) or + ((abs(ref.offset) mod 2)<>0) + ) + ) then begin tmpreg:=getintregister(list,OS_ADDR); a_loadaddr_ref_reg(list,ref,tmpreg);