From 80111a0a60e1912dc77208c2bc16bf275cfa3bb2 Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 20 Jun 2020 20:17:53 +0000 Subject: [PATCH] * make local variables in assembler blocks working again after r44933 * test for #37218 git-svn-id: trunk@45667 - --- .gitattributes | 1 + compiler/aarch64/racpugas.pas | 2 +- compiler/rautils.pas | 2 +- tests/webtbs/tw37218.pp | 22 ++++++++++++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 tests/webtbs/tw37218.pp diff --git a/.gitattributes b/.gitattributes index 6c222a1ab8..bef85d4356 100644 --- a/.gitattributes +++ b/.gitattributes @@ -18331,6 +18331,7 @@ tests/webtbs/tw37136.pp svneol=native#text/pascal tests/webtbs/tw37154.pp svneol=native#text/pascal tests/webtbs/tw3719.pp svneol=native#text/plain tests/webtbs/tw3721.pp svneol=native#text/plain +tests/webtbs/tw37218.pp svneol=native#text/pascal tests/webtbs/tw3742.pp svneol=native#text/plain tests/webtbs/tw3751.pp svneol=native#text/plain tests/webtbs/tw3758.pp svneol=native#text/plain diff --git a/compiler/aarch64/racpugas.pas b/compiler/aarch64/racpugas.pas index 086ac34100..19728e2b8a 100644 --- a/compiler/aarch64/racpugas.pas +++ b/compiler/aarch64/racpugas.pas @@ -838,7 +838,7 @@ Unit racpugas; else Message1(sym_e_unknown_id,expr); end - else + else if oper.opr.typ<>OPR_LOCAL then begin oper.InitRef; MaybeAddGotAddrMode; diff --git a/compiler/rautils.pas b/compiler/rautils.pas index 2fe44048ed..e9d55205c0 100644 --- a/compiler/rautils.pas +++ b/compiler/rautils.pas @@ -1098,7 +1098,7 @@ end; procedure TOperand.InitRef; {*********************************************************************} -{ Description: This routine first check if the opcode is of } +{ Description: This routine first check if the opcode is of } { type OPR_NONE, or OPR_REFERENCE , if not it gives out an error. } { If the operandtype = OPR_NONE or <> OPR_REFERENCE then it sets up } { the operand type to OPR_REFERENCE, as well as setting up the ref } diff --git a/tests/webtbs/tw37218.pp b/tests/webtbs/tw37218.pp new file mode 100644 index 0000000000..ce54570821 --- /dev/null +++ b/tests/webtbs/tw37218.pp @@ -0,0 +1,22 @@ +{ %CPU=aarch64 } +program project1; +uses crt; +procedure test; +var a:uint64; +begin +a:=1; + asm + mov x4,# 0 + mov x12,# 1 + add x4,x4,x12,lsl # 2 + str x4, a + end; + + writeln(a); + if a<>4 then + halt(1); +end; + +begin +test; +end.