From 4407670d15bd4110dc758305a4d74923a3710f89 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 30 Aug 2020 21:32:45 +0000 Subject: [PATCH] * Xtensa: fix operand size and location handling in TCPUAddNode.second_cmp git-svn-id: trunk@46735 - --- compiler/xtensa/ncpuadd.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/xtensa/ncpuadd.pas b/compiler/xtensa/ncpuadd.pas index a5cffc36e1..69daf0c942 100644 --- a/compiler/xtensa/ncpuadd.pas +++ b/compiler/xtensa/ncpuadd.pas @@ -158,7 +158,7 @@ interface location_reset_jump(location,truelab,falselab); - hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true); + hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,cgsize_orddef(OS_INT),true); if is_signed(left.resultdef) then case nodetype of @@ -187,7 +187,9 @@ interface cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,OS_INT,cond,right.location.value,left.location.register,location.truelabel) else begin - force_reg_left_right(false,false); + if not(right.location.loc in [LOC_CREGISTER,LOC_REGISTER]) then + hlcg.location_force_reg(current_asmdata.CurrAsmList,right.location,right.resultdef,cgsize_orddef(OS_INT),true); + if nf_swapped in flags then cg.a_cmp_reg_reg_label(current_asmdata.CurrAsmList,OS_INT,cond,left.location.register,right.location.register,location.truelabel) else