[LLVMbugs] [Bug 22947] New: Less efficient encoding using direct object emission

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 18 07:27:50 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=22947

            Bug ID: 22947
           Summary: Less efficient encoding using direct object emission
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: MC
          Assignee: unassignedbugs at nondot.org
          Reporter: russell_gallop at sn.scee.net
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

For the following source the code generated by direct object emission is less
efficient than outputting to .s. Using r232386.

$ cat decrement.c
int foo(int a) {
    return --a;
}
$ clang -c decrement.c -o decrement.o
$ clang -S decrement.c -o decrement.s && clang -c decrement.s -o
decrement_via_s.o
$ objdump -d decrement.o

decrement.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <foo>:
   0:   55                      push   %rbp
   1:   48 89 e5                mov    %rsp,%rbp
   4:   89 7d fc                mov    %edi,-0x4(%rbp)
   7:   8b 7d fc                mov    -0x4(%rbp),%edi
   a:   81 c7 ff ff ff ff       add    $0xffffffff,%edi
  10:   89 7d fc                mov    %edi,-0x4(%rbp)
  13:   89 f8                   mov    %edi,%eax
  15:   5d                      pop    %rbp
  16:   c3                      retq
$ objdump -d decrement_via_s.o

decrement_via_s.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <foo>:
   0:   55                      push   %rbp
   1:   48 89 e5                mov    %rsp,%rbp
   4:   89 7d fc                mov    %edi,-0x4(%rbp)
   7:   8b 7d fc                mov    -0x4(%rbp),%edi
   a:   83 c7 ff                add    $0xffffffff,%edi
   d:   89 7d fc                mov    %edi,-0x4(%rbp)
  10:   89 f8                   mov    %edi,%eax
  12:   5d                      pop    %rbp
  13:   c3                      retq

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150318/f4d5eec4/attachment.html>


More information about the llvm-bugs mailing list