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

           Summary: Unused lazy arguments generate redundant code in empty
                    inlined functions
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Mac OS X
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: peter.alexander...@gmail.com


--- Comment #0 from Peter Alexander <peter.alexander...@gmail.com> 2012-09-03 
13:32:12 PDT ---
% cat test.d
void foo(lazy ulong x) {}
void main(string[] args)
{
    foo(args.length);
}

admin@poita ~% dmd -inline -O -release test.d
admin@poita ~% otool -tV test | grep __Dmain: -A 9
__Dmain:
0000000100000dac    pushq    %rbp
0000000100000dad    movq    %rsp,%rbp
0000000100000db0    subq    $0x10,%rsp
0000000100000db4    movq    %rdi,0xf0(%rbp)
0000000100000db8    movq    %rsi,0xf8(%rbp)
0000000100000dbc    xorl    %eax,%eax
0000000100000dbe    movq    %rbp,%rsp
0000000100000dc1    popq    %rbp
0000000100000dc2    ret

Notice the redundant movq's. They aren't there when the parameter isn't lazy.

Ideally, this empty function would have no effect on the generated code.

Tested using DMD 2.060

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

Reply via email to