* adapt register if the size of the paraloc and the register differ, resolves #34409

git-svn-id: trunk@43617 -
This commit is contained in:
florian 2019-11-30 20:37:55 +00:00
parent 06c1a17d13
commit f2a8b8ad6a
3 changed files with 21 additions and 1 deletions

1
.gitattributes vendored
View File

@ -17783,6 +17783,7 @@ tests/webtbs/tw3435.pp svneol=native#text/plain
tests/webtbs/tw34380.pp svneol=native#text/plain
tests/webtbs/tw34385.pp svneol=native#text/plain
tests/webtbs/tw34385a.pp svneol=native#text/plain
tests/webtbs/tw34409.pp svneol=native#text/pascal
tests/webtbs/tw3441.pp svneol=native#text/plain
tests/webtbs/tw3443.pp svneol=native#text/plain
tests/webtbs/tw34438.pp svneol=native#text/pascal

View File

@ -84,6 +84,9 @@ interface
procinfo,
cpuinfo,
tgobj
{$ifdef x86}
,cgx86
{$endif x86}
;
{*****************************************************************************
@ -215,7 +218,10 @@ interface
begin
op.typ:=top_reg;
op.reg:=sym.localloc.register;
{$ifdef x86}
if reg2opsize(op.reg)<>TCGSize2Opsize[sym.localloc.size] then
op.reg:=newreg(getregtype(op.reg),getsupreg(op.reg),cgsize2subreg(getregtype(op.reg),sym.localloc.size));
{$endif x86}
{$ifdef avr}
case sofs of
1: op.reg:=cg.GetNextReg(op.reg);

13
tests/webtbs/tw34409.pp Normal file
View File

@ -0,0 +1,13 @@
{ %cpu=i386,x86_64 }
{ %norun }
{ %opt=-Rintel -O4 -a }
function foo ( w : word):byte; assembler;
asm
mov ax, w
end;
begin
foo(3);
end.