http://d.puremagic.com/issues/show_bug.cgi?id=1149


bearophile_h...@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_h...@eml.cc


--- Comment #3 from bearophile_h...@eml.cc 2012-02-22 15:38:35 PST ---
With the test code, this is the X86 asm I was seeing before this patch (-O
-release -inline):


__Dmain comdat
L0:     sub ESP,0Ch
        lea EAX,[ESP]
        mov ECX,offset FLAT:_D11TypeInfo_Ak6__initZ
        mov [ESP],0
        mov dword ptr 4[ESP],0
        push    EAX
        push    4
        push    ECX
        call    near ptr __d_arraysetlengthT
        mov ECX,010h[ESP]
        mov EDX,1
        mov EAX,0Ch[ESP]
        mov [ECX],EDX
        mov ECX,010h[ESP]
        mov EAX,0Ch[ESP]
        mov 4[ECX],EDX
        mov ECX,010h[ESP]
        mov EAX,0Ch[ESP]
        mov 8[ECX],EDX
        mov ECX,010h[ESP]
        mov EAX,0Ch[ESP]
        mov 0Ch[ECX],EDX
        add ESP,0Ch
        add ESP,0Ch
        xor EAX,EAX
        ret

-----------------------------

After the patch:

__Dmain comdat
L0:     sub ESP,0Ch
        lea EAX,[ESP]
        mov ECX,offset FLAT:_D11TypeInfo_Ak6__initZ
        mov [ESP],0
        mov dword ptr 4[ESP],0
        push    EAX
        push    4
        push    ECX
        call    near ptr __d_arraysetlengthT
        mov ECX,010h[ESP]
        mov EDX,1
        mov EAX,0Ch[ESP]
        mov [ECX],EDX
        mov ECX,010h[ESP]
        mov EAX,0Ch[ESP]
        mov 4[ECX],EDX
        mov ECX,010h[ESP]
        mov EAX,0Ch[ESP]
        mov 8[ECX],EDX
        mov ECX,010h[ESP]
        mov EAX,0Ch[ESP]
        mov 0Ch[ECX],EDX
        add ESP,0Ch
        add ESP,0Ch
        xor EAX,EAX
        ret

--------------------------------

objectdump after the patch, on a 64 bit systems (courtesy of q66 on IRC #D),
compiled with -release:

0000000000000000 <_Dmain>:
   0:   55                      push   %rbp
   1:   48 8b ec                mov    %rsp,%rbp
   4:   48 83 ec 18             sub    $0x18,%rsp
   8:   53                      push   %rbx
   9:   48 c7 45 f0 00 00 00    movq   $0x0,-0x10(%rbp)
  10:   00 
  11:   48 c7 45 f8 00 00 00    movq   $0x0,-0x8(%rbp)
  18:   00 
  19:   48 8d 55 f0             lea    -0x10(%rbp),%rdx
  1d:   48 be 04 00 00 00 00    mov    $0x4,%rsi
  24:   00 00 00 
  27:   48 bf 00 00 00 00 00    mov    $0x0,%rdi
  2e:   00 00 00 
  31:   e8 00 00 00 00          callq  36 <_Dmain+0x36>
  36:   b8 01 00 00 00          mov    $0x1,%eax
  3b:   48 8b 55 f8             mov    -0x8(%rbp),%rdx
  3f:   48 8b 5d f0             mov    -0x10(%rbp),%rbx
  43:   89 02                   mov    %eax,(%rdx)
  45:   48 8b 55 f8             mov    -0x8(%rbp),%rdx
  49:   48 8b 5d f0             mov    -0x10(%rbp),%rbx
  4d:   89 42 04                mov    %eax,0x4(%rdx)
  50:   48 8b 55 f8             mov    -0x8(%rbp),%rdx
  54:   48 8b 5d f0             mov    -0x10(%rbp),%rbx
  58:   89 42 08                mov    %eax,0x8(%rdx)
  5b:   48 8b 55 f8             mov    -0x8(%rbp),%rdx
  5f:   48 8b 5d f0             mov    -0x10(%rbp),%rbx
  63:   89 42 0c                mov    %eax,0xc(%rdx)
  66:   31 c0                   xor    %eax,%eax
  68:   5b                      pop    %rbx
  69:   c9                      leaveq 
  6a:   c3                      retq   

--------------------------------

So is this patch working?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to