* do not reuse a loaded reference for avrtiny in a_op_const*, resolves #38142

git-svn-id: trunk@47612 -
This commit is contained in:
florian 2020-11-27 21:16:31 +00:00
parent b0cbff6463
commit eb098a3d11

View File

@ -586,7 +586,8 @@ implementation
uses
globals,systems,fmodule,
verbose,paramgr,symsym,symtable,
tgobj,cutils,procinfo;
tgobj,cutils,procinfo,
cpuinfo;
{*****************************************************************************
basic functionallity
@ -1997,7 +1998,10 @@ implementation
tmpreg : tregister;
tmpref : treference;
begin
if assigned(ref.symbol) then
if assigned(ref.symbol)
{ for avrtiny, the code generator generates a ref which is Z relative and while using it,
Z is changed, so the following code breaks }
{$ifdef avr}and not(CPUAVR_16_REGS in cpu_capabilities[current_settings.cputype]){$endif avr} then
begin
tmpreg:=getaddressregister(list);
a_loadaddr_ref_reg(list,ref,tmpreg);
@ -2030,7 +2034,10 @@ implementation
tmpreg : tregister;
tmpref : treference;
begin
if assigned(ref.symbol) then
if assigned(ref.symbol)
{ for avrtiny, the code generator generates a ref which is Z relative and while using it,
Z is changed, so the following code breaks }
{$ifdef avr}and not(CPUAVR_16_REGS in cpu_capabilities[current_settings.cputype]){$endif avr} then
begin
tmpreg:=getaddressregister(list);
a_loadaddr_ref_reg(list,ref,tmpreg);