From fc50edfe31d0c1a6df9461a7ca183253be142199 Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 14 Feb 2020 21:27:43 +0000 Subject: [PATCH] * AVR: couple of fixes for CPUs with only 16 registers git-svn-id: trunk@44177 - --- compiler/avr/cpupara.pas | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/avr/cpupara.pas b/compiler/avr/cpupara.pas index 6d5e3211d0..0c4289e68a 100644 --- a/compiler/avr/cpupara.pas +++ b/compiler/avr/cpupara.pas @@ -170,7 +170,7 @@ unit cpupara; result:=not(def.size in [1,2,4]); } else - if (def.size > 8) then + if (def.size > 8) or ((CPUAVR_16_REGS in cpu_capabilities[current_settings.cputype]) and (def.size > 4)) then result:=true else result:=inherited ret_in_param(def,pd); @@ -343,7 +343,8 @@ unit cpupara; case loc of LOC_REGISTER: begin - if nextintreg>=RS_R8 then + if ((nextintreg>=RS_R8) and not(CPUAVR_16_REGS in cpu_capabilities[current_settings.cputype])) or + (nextintreg>=RS_R20) then begin paraloc^.loc:=LOC_REGISTER; paraloc^.size:=OS_8;