[LLVMbugs] [Bug 18972] New: testcase we fail to devirtualize but gcc does

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Feb 26 06:13:05 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18972

            Bug ID: 18972
           Summary: testcase we fail to devirtualize but gcc does
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: rafael.espindola at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Given

struct foo {
 virtual ~foo();
};
struct bar : public foo {
 virtual void zed();
};
void f() {
 foo *x(new bar);
 delete x;
}

clang at -O3 will produce a call via a vtable. It would be illegal to call
_ZN3barD0Ev, since we are not guaranteed by the ABI that it is available, but
what current gcc does instead is call _ZN3fooD2E.

To do this in llvm we would probably need one more linkage:
unavailable_but_known. The idea is that _ZN3barD0Ev is not
available_externally, it can be internal no another TU, but we know its value
anyway.

-- 
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/20140226/1ea050c1/attachment.html>


More information about the llvm-bugs mailing list