* patch Christo Crause: Use LDS for 8 bit references, resolves #38173

git-svn-id: trunk@47700 -
This commit is contained in:
florian 2020-12-06 16:40:30 +00:00
parent 4f3271500a
commit c0d75c1c69

View File

@ -2001,7 +2001,9 @@ implementation
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
{$ifdef avr}
and not((CPUAVR_16_REGS in cpu_capabilities[current_settings.cputype]) or (tcgsize2size[size]=1))
{$endif avr} then
begin
tmpreg:=getaddressregister(list);
a_loadaddr_ref_reg(list,ref,tmpreg);
@ -2037,7 +2039,9 @@ implementation
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
{$ifdef avr}
and not((CPUAVR_16_REGS in cpu_capabilities[current_settings.cputype]) or (tcgsize2size[size]=1))
{$endif avr} then
begin
tmpreg:=getaddressregister(list);
a_loadaddr_ref_reg(list,ref,tmpreg);
@ -2273,7 +2277,12 @@ implementation
begin
if not (Op in [OP_NOT,OP_NEG]) then
internalerror(2020050710);
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]) or (tcgsize2size[size]=1))
{$endif avr} then
begin
tmpreg:=getaddressregister(list);
a_loadaddr_ref_reg(list,ref,tmpreg);