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

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

admin@poita ~% dmd -inline -O -release test.d
admin@poita ~% otool -tV test | grep __Dmain: -A 9
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:
------- You are receiving this mail because: -------

Reply via email to