Преглед изворни кода

* based on a patch by Christo Crause: in finalizeavrcode, ignore assembler breq statements taking an absolute value, resolves #32109

git-svn-id: trunk@38089 -
florian пре 7 година
родитељ
комит
6b5a514148
3 измењених фајлова са 11 додато и 2 уклоњено
  1. 1 0
      .gitattributes
  2. 2 2
      compiler/avr/aasmcpu.pas
  3. 8 0
      tests/webtbs/tw32109.pp

+ 1 - 0
.gitattributes

@@ -15924,6 +15924,7 @@ tests/webtbs/tw32046.pp svneol=native#text/plain
 tests/webtbs/tw3207.pp svneol=native#text/plain
 tests/webtbs/tw3207.pp svneol=native#text/plain
 tests/webtbs/tw3210.pp svneol=native#text/plain
 tests/webtbs/tw3210.pp svneol=native#text/plain
 tests/webtbs/tw32108.pp svneol=native#text/pascal
 tests/webtbs/tw32108.pp svneol=native#text/pascal
+tests/webtbs/tw32109.pp svneol=native#text/pascal
 tests/webtbs/tw32111.pp svneol=native#text/pascal
 tests/webtbs/tw32111.pp svneol=native#text/pascal
 tests/webtbs/tw32115.pp svneol=native#text/pascal
 tests/webtbs/tw32115.pp svneol=native#text/pascal
 tests/webtbs/tw32118.pp svneol=native#text/pascal
 tests/webtbs/tw32118.pp svneol=native#text/pascal

+ 2 - 2
compiler/avr/aasmcpu.pas

@@ -445,8 +445,8 @@ implementation
                   ait_instruction:
                   ait_instruction:
                     case taicpu(curtai).opcode of
                     case taicpu(curtai).opcode of
                       A_BRxx:
                       A_BRxx:
-                        if (taicpu(curtai).InsOffset-taicpu(curtai).oper[0]^.ref^.symbol.offset>64) or
-                          (taicpu(curtai).InsOffset-taicpu(curtai).oper[0]^.ref^.symbol.offset<-63) then
+                        if (taicpu(curtai).oper[0]^.typ=top_ref) and ((taicpu(curtai).InsOffset-taicpu(curtai).oper[0]^.ref^.symbol.offset>64) or
+                          (taicpu(curtai).InsOffset-taicpu(curtai).oper[0]^.ref^.symbol.offset<-63)) then
                           begin
                           begin
                             if inasmblock then
                             if inasmblock then
                               Message(asmw_e_short_jmp_out_of_range)
                               Message(asmw_e_short_jmp_out_of_range)

+ 8 - 0
tests/webtbs/tw32109.pp

@@ -0,0 +1,8 @@
+{ %CPU=avr }
+{ %norun }
+program test;
+begin
+  asm
+    breq 0
+  end;
+end.