Martin wrote on Fri, 24 Aug 2012:

On 08/08/2012 15:37, Jonas Maebe wrote:

Martin wrote on Wed, 08 Aug 2012:

Out of curiosity. Is there an optimization like this
[removing calculation/load of unused parameters]

No.

 Are you sure? It seems the compiler disagrees with you.

I  tested with 2.7.1 (updated yesterday):

function Foo(s:string): string;
begin
  Result := s;
  Form1.Caption := s;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  //DebugLn(['abc']);
  //DebugLn('abc');
  DebugLn(foo('abc'));
end;

The assembler for FormCreate (no optimization used). It even omits the call to "Foo"...

How is debugln defined?


Jonas
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to