Bug in peephole optimizer - omits FS selector when needed
Original Reporter info from Mantis: laaca@seznam.cz
-
Reporter name: Ladislav Lacina
Original Reporter info from Mantis: laaca@seznam.cz
- Reporter name: Ladislav Lacina
Description:
In the past I reported bug 18113 about bugged Level 2 optimalization.
In current FPC version the produced code is slightly different but buggy too.
The compilation of MEM pseudoarray is under certain conditions confused, omits the generation of FS selector prefix and results on not working code.
This bug accurs when Level 2 compilation is on, or/and if "register variables" is on.
Analysis is and test case are bellow:
Steps to reproduce:
Procedure Confuse;
begin
end;
Procedure TestBug(chr:word);
begin
Confuse; {if you comment it, everything is fine even in Level 2}
Mem[$B800:0]:=byte(chr);
end;
begin
writeln(#13#10#13#10);
TestBug(42); {should print '*'}
readln;
end.
Mantis conversion info:
- Mantis ID: 26385
- OS: GO32V2
- Platform: i368
- Version: 2.6.4
- Monitored by: » laaca@seznam.cz (Ladislav Lacina)