On 21/01/2014 21:28, Florian Klämpfl wrote:
Can you post some example code? It might be worth to think about
improving this already in at the node level.


While getting examples, another issue:


with -O2 , -O3 or -O4

Note the
    movl    %eax,%edx
    movl    %edx,%eax

with -O1 it is
    movl    %eax,-4(%ebp)
    movl    -4(%ebp),%eax



.section .text.n_p$project1$_$tfoo_$__$$_init,"x"
    .balign 16,0x90
.globl    P$PROJECT1$_$TFOO_$__$$_INIT
P$PROJECT1$_$TFOO_$__$$_INIT:
# Temps allocated between esp+0 and esp+0
# Var $self located in register edx
# [19] begin
    movl    %eax,%edx
# Var $self located in register edx
# [20] Init;
    movl    %edx,%eax
    movl    (%edx),%edx
    call    *100(%edx)
# [21] end;
    ret

program project1;
{$mode objfpc}

type
  { TFoo }

  TFoo = class
    a,b : Integer;
    function Bar: Boolean;
    procedure Init; virtual;
  end;

function TFoo.Bar: Boolean;
begin
  Result := a <> b;
end;

procedure TFoo.Init;
begin
  Init;
end;

{ TFoo }


begin
end.

_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to