www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14044] New: dmd generates spurious functions in object file

https://issues.dlang.org/show_bug.cgi?id=14044

          Issue ID: 14044
           Summary: dmd generates spurious functions in object file
                    created from empty module
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: andrei erdani.com

Looking at http://asm.dlang.org, with DMD 2.065 the object file contains no
functions. But with 2.066.1 there are a few spurious functions generated:

_D6object7__arrayZ
    push   %rbp
    mov    %rsp,%rbp
    sub    $0x10,%rsp
    mov    %edi,-0x8(%rbp)
    mov    -0x8(%rbp),%edx
    mov    %rdx,-0x10(%rbp)
    mov    0x0(%rip),%rdx        # 19 <_D6object7__arrayZ+0x19>
    mov    0x0(%rip),%rdi        # 20 <_D6object7__arrayZ+0x20>
    mov    %rdx,%rsi
    mov    -0x10(%rbp),%rdx
    callq  2c <_D6object7__arrayZ+0x2c>
    nopl   0x0(%rax)

void object.__assert(int)
    push   %rbp
    mov    %rsp,%rbp
    sub    $0x10,%rsp
    mov    %edi,-0x8(%rbp)
    mov    -0x8(%rbp),%edx
    mov    %rdx,-0x10(%rbp)
    mov    0x0(%rip),%rdx        # 19 <void object.__assert(int)+0x19>
    mov    0x0(%rip),%rdi        # 20 <void object.__assert(int)+0x20>
    mov    %rdx,%rsi
    mov    -0x10(%rbp),%rdx
    callq  2c <void object.__assert(int)+0x2c>
    nopl   0x0(%rax)

void object.__unittest_fail(int)
    push   %rbp
    mov    %rsp,%rbp
    sub    $0x10,%rsp
    mov    %edi,-0x8(%rbp)
    mov    -0x8(%rbp),%edx
    mov    %rdx,-0x10(%rbp)
    mov    0x0(%rip),%rdx        # 19 <void object.__unittest_fail(int)+0x19>
    mov    0x0(%rip),%rdi        # 20 <void object.__unittest_fail(int)+0x20>
    mov    %rdx,%rsi
    mov    -0x10(%rbp),%rdx
    callq  2c <void object.__unittest_fail(int)+0x2c>
    leaveq 
    retq   
    ...

--
Jan 25 2015