diff --git a/compiler/avr/cpupara.pas b/compiler/avr/cpupara.pas index 45d6cd1c19..3b12737940 100644 --- a/compiler/avr/cpupara.pas +++ b/compiler/avr/cpupara.pas @@ -40,7 +40,7 @@ unit cpupara; function ret_in_param(def:tdef;pd:tabstractprocdef):boolean;override; function create_paraloc_info(p : tabstractprocdef; side: tcallercallee):longint;override; function create_varargs_paraloc_info(p : tabstractprocdef; side: tcallercallee; varargspara:tvarargsparalist):longint;override; - function get_funcretloc(p : tabstractprocdef; side: tcallercallee; forcetempdef: tdef): tcgpara;override; + function get_funcretloc(p : tabstractprocdef; side: tcallercallee; forcetempdef: tdef): tcgpara;override; private procedure init_values(var curintreg, curfloatreg, curmmreg: tsuperregister; var cur_stack_offset: aword); function create_paraloc_info_intern(p : tabstractprocdef; side: tcallercallee; paras: tparalist; diff --git a/compiler/hlcgobj.pas b/compiler/hlcgobj.pas index 848dc1987b..a49df48e67 100644 --- a/compiler/hlcgobj.pas +++ b/compiler/hlcgobj.pas @@ -834,11 +834,17 @@ implementation recorddef, setdef: result:=R_INTREGISTER; + procvardef: + { getaddressregister cannot handle if multiple registers + are required for a single element } + if is_methodpointer(def) then + result:=R_INTREGISTER + else + result:=R_ADDRESSREGISTER; stringdef, pointerdef, classrefdef, objectdef, - procvardef, procdef, formaldef: result:=R_ADDRESSREGISTER;