mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-23 19:09:32 +02:00
* fixed LdrLdr2LdrMov optimisation in case the first and second ldr have
a different size (disable it in that case) + test git-svn-id: trunk@25778 -
This commit is contained in:
parent
5276159e77
commit
10ae87f11c
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10754,6 +10754,7 @@ tests/test/library/ttdlltest.pp svneol=native#text/plain
|
||||
tests/test/library/ulib2a.pp svneol=native#text/plain
|
||||
tests/test/library/ulib2b.pp svneol=native#text/plain
|
||||
tests/test/opt/README.txt svneol=native#text/plain
|
||||
tests/test/opt/tarmls1.pp svneol=native#text/plain
|
||||
tests/test/opt/tarmsa1.pp svneol=native#text/plain
|
||||
tests/test/opt/tarmshift.pp svneol=native#text/plain
|
||||
tests/test/opt/tcaseopt1.pp svneol=native#text/plain
|
||||
|
@ -663,10 +663,11 @@ Implementation
|
||||
ldr reg1,ref
|
||||
mov reg2,reg1
|
||||
}
|
||||
if RefsEqual(taicpu(p).oper[1]^.ref^,taicpu(hp1).oper[1]^.ref^) and
|
||||
(taicpu(p).oper[0]^.reg<>taicpu(hp1).oper[1]^.ref^.index) and
|
||||
(taicpu(p).oper[0]^.reg<>taicpu(hp1).oper[1]^.ref^.base) and
|
||||
(taicpu(hp1).oper[1]^.ref^.addressmode=AM_OFFSET) then
|
||||
if (taicpu(p).oppostfix=taicpu(hp1).oppostfix) and
|
||||
RefsEqual(taicpu(p).oper[1]^.ref^,taicpu(hp1).oper[1]^.ref^) and
|
||||
(taicpu(p).oper[0]^.reg<>taicpu(hp1).oper[1]^.ref^.index) and
|
||||
(taicpu(p).oper[0]^.reg<>taicpu(hp1).oper[1]^.ref^.base) and
|
||||
(taicpu(hp1).oper[1]^.ref^.addressmode=AM_OFFSET) then
|
||||
begin
|
||||
if taicpu(hp1).oper[0]^.reg=taicpu(p).oper[0]^.reg then
|
||||
begin
|
||||
|
23
tests/test/opt/tarmls1.pp
Normal file
23
tests/test/opt/tarmls1.pp
Normal file
@ -0,0 +1,23 @@
|
||||
{ %opt=-O2 }
|
||||
|
||||
type
|
||||
trec = record
|
||||
w: longint;
|
||||
end;
|
||||
|
||||
function test(var r: trec): byte;
|
||||
|
||||
begin
|
||||
test:=byte(r.w);
|
||||
r.w:=r.w shr 8;
|
||||
end;
|
||||
|
||||
var
|
||||
r: trec;
|
||||
begin
|
||||
r.w:=$1234;
|
||||
if test(r)<>$34 then
|
||||
halt(1);
|
||||
if r.w<>$12 then
|
||||
halt(2);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user