[Issue 9722] New: optimizer kills GOT to EBX load

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 14 13:50:10 PDT 2013


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

           Summary: optimizer kills GOT to EBX load
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: code at dawg.eu


--- Comment #0 from Martin Nowak <code at dawg.eu> 2013-03-14 13:50:09 PDT ---
cat > bug.d << CODE
void foo()
{
    bar();
}

void bar()
{
}
CODE

--------------------
dmd -c -fPIC -m32 bug
--------------------
_D3bug3fooFZv PROC NEAR
        push    ebp                                     ; 0000 _ 55
        mov     ebp, esp                                ; 0001 _ 8B. EC
        sub     esp, 4                                  ; 0003 _ 83. EC, 04
        push    ebx                                     ; 0006 _ 53
        call    ?_003                                   ; 0007 _ E8, 00000000

?_003   LABEL NEAR
        pop     eax                                     ; 000C _ 58
        add     eax, offset _GLOBAL_OFFSET_TABLE_-$+1H  ; 000D _ 05,
00000002(GOT r)
        mov     dword ptr [ebp-4H], eax                 ; 0012 _ 89. 45, FC
        mov     ebx, dword ptr [ebp-4H]                 ; 0015 _ 8B. 5D, FC
        call    _D3bug3barFZv                           ; 0018 _ E8,
FFFFFFFC(PLT r)
        pop     ebx                                     ; 001D _ 5B
        leave                                           ; 001E _ C9
        ret                                             ; 001F _ C3
_D3bug3fooFZv ENDP
--------------------
dmd -c -fPIC -m32 -O bug
--------------------
_D3bug3fooFZv PROC NEAR
        push    ebp                                     ; 0000 _ 55
        mov     ebp, esp                                ; 0001 _ 8B. EC
        push    eax                                     ; 0003 _ 50
        push    ebx                                     ; 0004 _ 53
        call    _D3bug3barFZv                           ; 0005 _ E8,
FFFFFFFC(PLT r)
        pop     ebx                                     ; 000A _ 5B
        mov     esp, ebp                                ; 000B _ 8B. E5
        pop     ebp                                     ; 000D _ 5D
        ret                                             ; 000E _ C3
_D3bug3fooFZv ENDP

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


More information about the Digitalmars-d-bugs mailing list