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: [email protected]
Reporter: [email protected]
CC: [email protected]
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs