From 4430422489633ac2fcd7c8833267ecf9cfbb9361 Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 28 Dec 2022 22:05:23 +0100 Subject: [PATCH] * improve module local data accesses by avoiding a got read --- compiler/aarch64/cgcpu.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/aarch64/cgcpu.pas b/compiler/aarch64/cgcpu.pas index 5c14b2e11e..2d4e478238 100644 --- a/compiler/aarch64/cgcpu.pas +++ b/compiler/aarch64/cgcpu.pas @@ -184,7 +184,7 @@ implementation preferred_newbasereg:=getaddressregister(list); { load the (GOT) page } reference_reset_symbol(href,ref.symbol,0,8,[]); - if ((ref.symbol.typ in [AT_FUNCTION,AT_LABEL]) and + if ((ref.symbol.typ in [AT_FUNCTION,AT_LABEL,AT_DATA]) and (ref.symbol.bind in [AB_LOCAL,AB_GLOBAL])) or ((ref.symbol.typ=AT_DATA) and (ref.symbol.bind=AB_LOCAL)) or @@ -198,7 +198,7 @@ implementation href.symbol:=ref.symbol; { code symbols defined in the current compilation unit do not have to be accessed via the GOT } - if ((ref.symbol.typ in [AT_FUNCTION,AT_LABEL]) and + if ((ref.symbol.typ in [AT_FUNCTION,AT_LABEL,AT_DATA]) and (ref.symbol.bind in [AB_LOCAL,AB_GLOBAL])) or ((ref.symbol.typ=AT_DATA) and (ref.symbol.bind=AB_LOCAL)) or