the following code:
{$mode objfpc}
var
a: Integer;
begin
a := a + 1;
asm nop end;
end.generates (under -O2):
movl U_P$PROGRAM_A,%eax
incl %eax
movl %eax,U_P$PROGRAM_A
nop
instead of a single "incl".
removing either "asm" statement OR $mode directive reinstates the optimization (although in the latter case with "incw", of course).
This obviously never matters in practice, but may be a symptom of some more serious problem. Should I file a bug report?
