According to FPL:
[...]
1 program model(input, output); 2 var 3 i : integer; 4 5 begin 6 repeat 7 for i:=1 to 10 do 8 if 1=1 then 9 writeln('*'); 10 until 1=2; 11 end.
[Debugging the program above ...] Once reached the 'for' statement, only one star is printed then the pointer directely jumps on repeat, not printing ten stars in a row, just one. Nothing is changed in 'begin end;' insertion in the code.
That's not a bug, that's optimization. GPC sees
* that "if 1=1" is always true ("if true") and eliminates that line, and
* that the program just prints stars forever independent of the counter `i' and eliminates the counting (the `for' loop).
This results in
repeat writeln ( '*' ); until false;
OTOH, if you observe the same behaviour with all optimization turned *off* (i.e. you do not give the `-O' switch to the call to `gpc'), it *is* a bug, not in code generation but in GPC's generation of debugging information.
Please let us know which is the case.
Greetings,
Peter