Martin G C Davies wrote:
Yesterday I posted:-
What is the status as far as using optimization is concerned? Is it supposed to be usable? If so I have a problem...
Optimization yes, bit-fiddling not always (in particular the packed subranges which are a nonstandard extension, and were apparently not too well debugged yet; a regular subrange in a packed record (the standard way) seems to work better in this case).
module opt;
type mylupage = record datadisp : packed 0..31 end ; mylopage = ^mylupage;
function lichkp1( mypage : mylopage ) : integer ; begin if ( mypage^.datadisp < 21 ) or ( mypage^.datadisp > 25 ) then lichkp1 := 100 else lichkp1 := 200 ; end ;
end.
and when I compile with
gpc -O opt4.pas -S
[...]
So, as you can see, lichp1 will return 100 whatever the input.
The following patch should fix it, thanks for the report. (martin4*.pas)
Frank