diff --git a/compiler/arm/cpupara.pas b/compiler/arm/cpupara.pas index b2a59813c2..0626c87b6b 100644 --- a/compiler/arm/cpupara.pas +++ b/compiler/arm/cpupara.pas @@ -163,7 +163,10 @@ unit cpupara; filedef: getparaloc:=LOC_REGISTER; arraydef: - getparaloc:=LOC_REFERENCE; + if is_dynamic_array(p) then + getparaloc:=LOC_REGISTER + else + getparaloc:=LOC_REFERENCE; setdef: if is_smallset(p) then getparaloc:=LOC_REGISTER diff --git a/compiler/avr/cpupara.pas b/compiler/avr/cpupara.pas index 67c36da7c1..8a51b1ec45 100644 --- a/compiler/avr/cpupara.pas +++ b/compiler/avr/cpupara.pas @@ -99,7 +99,10 @@ unit cpupara; filedef: getparaloc:=LOC_REGISTER; arraydef: - getparaloc:=LOC_REFERENCE; + if is_dynamic_array(p) then + getparaloc:=LOC_REGISTER + else + getparaloc:=LOC_REFERENCE; setdef: if is_smallset(p) then getparaloc:=LOC_REGISTER diff --git a/compiler/i8086/cpupara.pas b/compiler/i8086/cpupara.pas index 224d6a21f5..55f3b45a96 100644 --- a/compiler/i8086/cpupara.pas +++ b/compiler/i8086/cpupara.pas @@ -629,7 +629,8 @@ unit cpupara; if (parareg<=high(parasupregs)) and (paralen<=sizeof(aint)) and (not(hp.vardef.typ in [floatdef,recorddef,arraydef]) or - pushaddr) and + pushaddr or + is_dynamic_array(hp.vardef)) and (not(vo_is_parentfp in hp.varoptions) or not(po_delphi_nested_cc in p.procoptions)) then begin diff --git a/compiler/powerpc/cpupara.pas b/compiler/powerpc/cpupara.pas index ed190d59b2..1840690f03 100644 --- a/compiler/powerpc/cpupara.pas +++ b/compiler/powerpc/cpupara.pas @@ -165,7 +165,10 @@ unit cpupara; filedef: result:=LOC_REGISTER; arraydef: - result:=LOC_REFERENCE; + if is_dynamic_array(p) then + getparaloc:=LOC_REGISTER + else + result:=LOC_REFERENCE; setdef: if is_smallset(p) then result:=LOC_REGISTER diff --git a/compiler/powerpc64/cpupara.pas b/compiler/powerpc64/cpupara.pas index b8d6300d54..c04839001a 100644 --- a/compiler/powerpc64/cpupara.pas +++ b/compiler/powerpc64/cpupara.pas @@ -146,7 +146,10 @@ begin filedef: result := LOC_REGISTER; arraydef: - result := LOC_REFERENCE; + if is_dynamic_array(p) then + getparaloc:=LOC_REGISTER + else + result := LOC_REFERENCE; setdef: if is_smallset(p) then result := LOC_REGISTER