[LLVMbugs] [Bug 21421] New: relocations for new removed when optimization turned on

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Oct 30 17:19:40 PDT 2014


            Bug ID: 21421
           Summary: relocations for new removed when optimization turned
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: danalbert at google.com
                CC: danalbert at google.com, eric at efcs.ca,
                    llvmbugs at cs.uiuc.edu, srhines at google.com
            Blocks: 21420
    Classification: Unclassified

Enabling -Os or -O2 (probably others, but haven't checked) for the libc++ tests
to fail. Inspection shows this is because the optimization is causing no
relocation to nothrow new (mangled: _ZnwjRKSt9nothrow_t) to be emitted.

# With -O0
$ readelf -r foo.o | grep _ZnwjRK
00000018  0000840a R_ARM_THM_CALL    00000000   _ZnwjRKSt9nothrow_t

# With -Os
$ readelf -r baz.o | grep _ZnwjRK
# no output

The emitted IR shows no reference to _ZnwjRKSt9nothrow_t at -Os, but does at
-O0, so I'm assuming this is a clang codegen issue. Also checked with
-fno-assume-sane-operator-new, so I don't think this is related to the
new/delete being optimized out.

EricWF checked GCC, and said that it exhibits the correct behavior.

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/20141031/0668d54f/attachment.html>

More information about the llvm-bugs mailing list