[Issue 5788] Better optimize [] (empty dynamic array literals)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 22 15:30:36 UTC 2018


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

Dmitry Olshansky <dmitry.olsh at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |bootcamp, performance
                 CC|                            |dmitry.olsh at gmail.com

--- Comment #4 from Dmitry Olshansky <dmitry.olsh at gmail.com> ---
Still here with DMD 2.080:

0000000000000000 <_D4dbug3fooFZAi>:
   0:   55                      push   %rbp
   1:   48 8b ec                mov    %rsp,%rbp
   4:   31 f6                   xor    %esi,%esi
   6:   48 8b 3d 00 00 00 00    mov    0x0(%rip),%rdi        # d
<_D4dbug3fooFZAi+0xd>
   d:   e8 00 00 00 00          callq  12 <_D4dbug3fooFZAi+0x12>
  12:   48 89 c2                mov    %rax,%rdx
  15:   31 c0                   xor    %eax,%eax
  17:   5d                      pop    %rbp
  18:   c3                      retq
  19:   00 00                   add    %al,(%rax)
        ...

Disassembly of section .text._D4dbug3barFZAi:

0000000000000000 <_D4dbug3barFZAi>:
   0:   55                      push   %rbp
   1:   48 8b ec                mov    %rsp,%rbp
   4:   31 c0                   xor    %eax,%eax
   6:   31 d2                   xor    %edx,%edx
   8:   5d                      pop    %rbp
   9:   c3                      retq
        ...

--


More information about the Digitalmars-d-bugs mailing list