[LLVMbugs] [Bug 17151] New: missed optimization: unused std::string

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Sep 8 02:07:41 PDT 2013


            Bug ID: 17151
           Summary: missed optimization: unused std::string
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ruslan_baratov at yahoo.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

>cat test.cpp
#include <string>

void foo() {
  std::string a = "abc";

void boo() {

Expected, that both 'foo' and 'boo' produce same asm, but it's not:

>clang++ -O3 -stdlib=libc++ -save-temps -O3 -c -fomit-frame-pointer test.cpp
>cat test.s
__Z3foov:                               ## @_Z3foov
    pushq    %rbx
    subq    $32, %rsp
    leaq    8(%rsp), %rbx
    leaq    L_.str(%rip), %rsi
    movq    %rbx, %rdi
    movl    $3, %edx
    movq    %rbx, %rdi
    addq    $32, %rsp
    popq    %rbx

__Z3boov:                               ## @_Z3boov

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/20130908/d5bb07dd/attachment.html>

More information about the llvm-bugs mailing list