Browse Source

* bail out early in tcgaarch64.make_simple_ref if possible

florian 1 year ago
parent
commit
6c50c02f7c
1 changed files with 3 additions and 0 deletions
  1. 3 0
      compiler/aarch64/cgcpu.pas

+ 3 - 0
compiler/aarch64/cgcpu.pas

@@ -312,6 +312,9 @@ implementation
         { base + offset }
         { base + offset }
         if ref.base<>NR_NO then
         if ref.base<>NR_NO then
           begin
           begin
+            if ref.offset=0 then
+              exit;
+
             { valid offset for LDUR/STUR -> use that }
             { valid offset for LDUR/STUR -> use that }
             if (ref.addressmode=AM_OFFSET) and
             if (ref.addressmode=AM_OFFSET) and
                (op in [A_LDR,A_STR]) and
                (op in [A_LDR,A_STR]) and