[Issue 2008] Poor optimization of functions with ref parameters

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 9 04:41:40 PDT 2010


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



--- Comment #8 from Brad Roberts <braddr at puremagic.com> 2010-05-09 04:41:38 PDT ---
Testing with David's code, with -O -inline, here's the new _Dmain:

_Dmain:
                push    EBP
                mov     EBP,ESP
                mov     EAX,offset
FLAT:_D3std5stdio6stdoutS3std5stdio4File at SYM32
                push    0
                push    0Ah
                call    near ptr
_D3std5stdio4File14__T5writeTkTaZ5writeMFkaZv at PC32
                xor     EAX,EAX
                pop     EBP
                ret

Without -O:
_Dmain:
                push    EBP
                mov     EBP,ESP
                sub     ESP,024h
                push    EBX
                push    ESI
                xor     EAX,EAX
                mov     -024h[EBP],EAX
                mov     -020h[EBP],EAX
                lea     ECX,-024h[EBP]
                mov     -01Ch[EBP],ECX
                lea     EDX,-020h[EBP]
                mov     -018h[EBP],EDX
                mov     EBX,[ECX]
                mov     -014h[EBP],EBX
                mov     ESI,[EDX]
                mov     [ECX],ESI
                mov     [EDX],EBX
                lea     EAX,-024h[EBP]
                mov     -010h[EBP],EAX
                lea     ECX,-020h[EBP]
                mov     -0Ch[EBP],ECX
                mov     EDX,[EAX]
                mov     -8[EBP],EDX
                mov     EBX,[ECX]
                mov     [EAX],EBX
                mov     [ECX],EDX
                mov     ESI,-024h[EBP]
                mov     -4[EBP],ESI
                push    ESI
                push    0Ah
                mov     EAX,offset
FLAT:_D3std5stdio6stdoutS3std5stdio4File at SYM32
                call    near ptr
_D3std5stdio4File14__T5writeTkTaZ5writeMFkaZv at PC32
                xor     EAX,EAX
                pop     ESI
                pop     EBX
                leave
                ret

-- 
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