[LLVMbugs] [Bug 17111] New: missing nop after branch
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Thu Sep 5 12:09:18 PDT 2013
http://llvm.org/bugs/show_bug.cgi?id=17111
Bug ID: 17111
Summary: missing nop after branch
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Backend: PowerPC
Assignee: unassignedbugs at nondot.org
Reporter: nlewycky at google.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Testcase:
class Base {
protected:
Base() {}
public:
virtual ~Base();
virtual void BaseMethod() {}
};
struct Derived : public Base {
~Derived() {
DerivedMethod();
}
void DerivedMethod();
virtual void BaseMethod();
};
void Derived::DerivedMethod() {}
void Derived::BaseMethod() {}
The bug is in the assembly generated for the destructor. Here's a snippet:
.Ltmp4:
std 5, 120(31)
bl _ZN7Derived13DerivedMethodEv
.Ltmp5:
b .LBB4_1
That doesn't leave enough space for the linker to insert the TOC reload when
resolving the R_PPC64_REL24 relocation. There needs to be a nop after the
branch+link instruction.
Reproduce with:
clang -target powerpc64-pc-linux-gnu -fpic testcase.cc -S -o -
Ultimately the symptom is a failure when linking:
error: call lacks nop, can't restore toc; recompile with -fPIC
--
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/20130905/2010d823/attachment.html>
More information about the llvm-bugs
mailing list