mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-06 10:07:54 +02:00
* fix abs() intrinsic optimisation, resolves #37301
git-svn-id: trunk@45732 -
This commit is contained in:
parent
5ad02a3799
commit
3caacc529a
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -18348,6 +18348,7 @@ tests/webtbs/tw37228.pp svneol=native#text/plain
|
||||
tests/webtbs/tw37254.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37261.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37272a.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37301.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3742.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3751.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3758.pp svneol=native#text/plain
|
||||
|
@ -4322,14 +4322,14 @@ unit aoptx86;
|
||||
with taicpu(hp4).oper[OperIdx]^ do
|
||||
case typ of
|
||||
top_reg:
|
||||
if reg = NR_EDX then
|
||||
reg := NR_EAX;
|
||||
if getsupreg(reg) = RS_EDX then
|
||||
reg := newreg(R_INTREGISTER,RS_EAX,getsubreg(reg));
|
||||
top_ref:
|
||||
begin
|
||||
if ref^.base = NR_EDX then
|
||||
ref^.base := NR_EAX;
|
||||
if ref^.index = NR_EDX then
|
||||
ref^.index := NR_EAX;
|
||||
if getsupreg(reg) = RS_EDX then
|
||||
ref^.base := newreg(R_INTREGISTER,RS_EAX,getsubreg(reg));
|
||||
if getsupreg(reg) = RS_EDX then
|
||||
ref^.index := newreg(R_INTREGISTER,RS_EAX,getsubreg(reg));
|
||||
end;
|
||||
else
|
||||
;
|
||||
|
13
tests/webtbs/tw37301.pp
Normal file
13
tests/webtbs/tw37301.pp
Normal file
@ -0,0 +1,13 @@
|
||||
{ %OPT=-O- -O1 }
|
||||
program testbug;
|
||||
{$mode objfpc}{$h+}
|
||||
var
|
||||
i: Integer;
|
||||
b: Byte;
|
||||
w: Word;
|
||||
begin
|
||||
i := 53;
|
||||
b := 0;
|
||||
w := abs(i-b);
|
||||
WriteLn(w);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user