--- Merging r49236 into '.':

U    compiler/aarch64/hlcgcpu.pas
A    tests/webtbs/tw38766.pp
--- Recording mergeinfo for merge of r49236 into '.':
 U   .

git-svn-id: branches/fixes_3_2@49237 -
This commit is contained in:
Jonas Maebe 2021-04-19 20:52:46 +00:00
parent 3037276c8a
commit acb59c7592
3 changed files with 31 additions and 1 deletions

1
.gitattributes vendored
View File

@ -17855,6 +17855,7 @@ tests/webtbs/tw3864.pp svneol=native#text/plain
tests/webtbs/tw3865.pp svneol=native#text/plain
tests/webtbs/tw38695.pp svneol=native#text/pascal
tests/webtbs/tw3870.pp svneol=native#text/plain
tests/webtbs/tw38766.pp svneol=native#text/plain
tests/webtbs/tw3893.pp svneol=native#text/plain
tests/webtbs/tw3898.pp svneol=native#text/plain
tests/webtbs/tw3899.pp svneol=native#text/plain

View File

@ -212,7 +212,8 @@ implementation
if slopt in [SL_SETZERO,SL_SETMAX] then
inherited
else if not(sreg.bitlen in [32,64]) or
(sreg.startbit<>0) then
(sreg.startbit<>0) or
(getsubreg(fromreg)<getsubreg(sreg.subsetreg)) then
begin
makeregssamesize(list,def_cgsize(fromsize),sreg.subsetregsize,fromreg,sreg.subsetreg,fromreg,toreg);
list.concat(taicpu.op_reg_reg_const_const(A_BFI,toreg,fromreg,sreg.startbit,sreg.bitlen))

28
tests/webtbs/tw38766.pp Normal file
View File

@ -0,0 +1,28 @@
{$mode objfpc}
type
trec = record
x, y: longint;
end;
function max(x,y: longint): longint;
begin
if x>y then
result:=x
else
result:=y;
end;
function test: trec; inline;
begin
result.x:=1;
result.y:=2;
result.x:=max(result.x,result.y);
end;
begin
if test.x<>2 then
halt(1);
if test.y<>2 then
halt(2);
end.