mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 06:49:27 +02:00
Fixed bug in peephole optimizer.
git-svn-id: branches/laksen/riscv_new@39486 -
This commit is contained in:
parent
2499129ba5
commit
a906feb05e
@ -527,6 +527,14 @@ uses cutils, cclasses;
|
||||
function taicpu.spilling_get_operation_type_ref(opnr: longint; reg: tregister): topertype;
|
||||
begin
|
||||
result := operand_read;
|
||||
case opcode of
|
||||
{$ifdef RISCV64}
|
||||
A_SD,
|
||||
{$endif RISCV64}
|
||||
A_SB,A_SH,A_SW:
|
||||
if opnr=1 then
|
||||
result:=operand_write;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
@ -112,6 +112,7 @@ implementation
|
||||
(hp1.typ=ait_instruction) and
|
||||
(taicpu(hp1).opcode=A_ADDI) and
|
||||
(taicpu(hp1).ops=3) and
|
||||
(taicpu(p).oper[0]^.reg=taicpu(hp1).oper[1]^.reg) and
|
||||
(taicpu(p).oper[2]^.typ=top_const) and
|
||||
is_imm12(taicpu(p).oper[2]^.val+taicpu(hp1).oper[2]^.val) and
|
||||
(not RegModifiedBetween(taicpu(p).oper[1]^.reg, p,hp1)) and
|
||||
|
Loading…
Reference in New Issue
Block a user