[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


            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


  class Base {
    Base() {}

    virtual ~Base();
    virtual void BaseMethod() {}

  struct Derived : public Base {
    ~Derived() {

    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:

         std 5, 120(31)
         bl _ZN7Derived13DerivedMethodEv
         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