* patch by Christo Crause: generate parameter location information in att assembler mode, resolves

* forbid that parameters are subscribed in assembler, if they are references and take more than one register
+ test

git-svn-id: trunk@38125 -
This commit is contained in:
florian 2018-02-05 22:11:00 +00:00
parent 640480272f
commit a29f968b3b
4 changed files with 33 additions and 1 deletions

1
.gitattributes vendored
View File

@ -14337,6 +14337,7 @@ tests/webtbf/tw32605.pp svneol=native#text/plain
tests/webtbf/tw3267.pp svneol=native#text/plain
tests/webtbf/tw3275.pp svneol=native#text/plain
tests/webtbf/tw32906.pp svneol=native#text/plain
tests/webtbf/tw32915.pp svneol=native#text/pascal
tests/webtbf/tw3294.pp svneol=native#text/plain
tests/webtbf/tw32949.pp svneol=native#text/pascal
tests/webtbf/tw3331.pp svneol=native#text/plain

View File

@ -120,7 +120,7 @@ unit raatt;
{ globals }
verbose,systems,
{ input }
scanner,
scanner, pbase,
{ symtable }
symbase,symtype,symsym,symdef,symtable,
{$ifdef x86}
@ -1049,6 +1049,11 @@ unit raatt;
_asmsorted:=TRUE;
end;
curlist:=TAsmList.Create;
{ we might need to know which parameters are passed in registers }
if not parse_generic then
current_procinfo.generate_parameter_info;
lasTSec:=sec_code;
{ start tokenizer }
gettoken;

View File

@ -155,6 +155,7 @@ unit rasm;
if (po_assembler in current_procinfo.procdef.procoptions) and
(sym.typ=paravarsym) and
(tparavarsym(sym).paraloc[calleeside].location^.loc=LOC_REGISTER) and
not assigned(tparavarsym(sym).paraloc[calleeside].location^.Next) and
isimplicitpointer then
exit;

25
tests/webtbf/tw32915.pp Normal file
View File

@ -0,0 +1,25 @@
{ %cpu=avr }
{ %fail }
program test;
type
TUintRecord = packed record
l:byte;
h:byte;
end;
procedure delayloop2(const counter: TUintRecord); assembler;
asm
mov XH, counter.h
mov XL, counter.l
end;
var
t: TUintRecord;
begin
t.l := 1;
t.h := 0;
delayloop2(t);
end.