<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Patchpoints/stackmaps fail without -disable-fp-elim"
   href="http://llvm.org/bugs/show_bug.cgi?id=21107">21107</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Patchpoints/stackmaps fail without -disable-fp-elim
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>kmod@dropbox.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Patchpoints and stackmaps seem to fail when given an alloca and frame pointer
elimination is enabled.  I've attached a simple test case using a stackmap,
which fails when trying to eliminate the frame pointer usage for the alloca
argument, with

llc:
/opt/kmod_unenc/pyston_deps/llvm-trunk/lib/Target/X86/X86RegisterInfo.cpp:512:
virtual void
llvm::X86RegisterInfo::eliminateFrameIndex(llvm::MachineBasicBlock::iterator,
int, unsigned int, llvm::RegScavenger*) const: Assertion `BasePtr == FramePtr
&& "Expected the FP as base register"' failed.

Full backtrace:
#0  0x00007ffff684dd05 in *__GI_raise (sig=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007ffff6851ab6 in *__GI_abort () at abort.c:92
#2  0x00007ffff68467c5 in *__GI___assert_fail (assertion=0x15073f0 "BasePtr ==
FramePtr && \"Expected the FP as base register\"", 
    file=<optimized out>, line=512, function=<optimized out>) at assert.c:81
#3  0x000000000098d0d0 in llvm::X86RegisterInfo::eliminateFrameIndex
(this=0x2000340, II=..., SPAdj=0, FIOperandNum=3, RS=0x0)
    at
/opt/kmod_unenc/pyston_deps/llvm-trunk/lib/Target/X86/X86RegisterInfo.cpp:512
#4  0x0000000000ecf3f6 in llvm::PEI::replaceFrameIndices (this=0x2041d40,
BB=0x2053d20, Fn=..., SPAdj=@0x7fffffffcdbc: 0)
    at
/opt/kmod_unenc/pyston_deps/llvm-trunk/lib/CodeGen/PrologEpilogInserter.cpp:815
#5  0x0000000000eced43 in llvm::PEI::replaceFrameIndices (this=0x2041d40,
Fn=...)
    at
/opt/kmod_unenc/pyston_deps/llvm-trunk/lib/CodeGen/PrologEpilogInserter.cpp:725
#6  0x0000000000eccab3 in llvm::PEI::runOnMachineFunction (this=0x2041d40,
Fn=...)
    at
/opt/kmod_unenc/pyston_deps/llvm-trunk/lib/CodeGen/PrologEpilogInserter.cpp:161
#7  0x0000000000e42c47 in llvm::MachineFunctionPass::runOnFunction
(this=0x2041d40, F=...)
    at
/opt/kmod_unenc/pyston_deps/llvm-trunk/lib/CodeGen/MachineFunctionPass.cpp:33
#8  0x00000000013fa57e in llvm::FPPassManager::runOnFunction (this=0x2026330,
F=...)
    at /opt/kmod_unenc/pyston_deps/llvm-trunk/lib/IR/LegacyPassManager.cpp:1544
#9  0x00000000013fa6ee in llvm::FPPassManager::runOnModule (this=0x2026330,
M=...)
    at /opt/kmod_unenc/pyston_deps/llvm-trunk/lib/IR/LegacyPassManager.cpp:1564
#10 0x00000000013faa42 in (anonymous namespace)::MPPassManager::runOnModule
(this=0x200c680, M=...)
    at /opt/kmod_unenc/pyston_deps/llvm-trunk/lib/IR/LegacyPassManager.cpp:1622
#11 0x00000000013fb0ec in llvm::legacy::PassManagerImpl::run (this=0x200c310,
M=...)
    at /opt/kmod_unenc/pyston_deps/llvm-trunk/lib/IR/LegacyPassManager.cpp:1729
#12 0x00000000013fb30b in llvm::legacy::PassManager::run (this=0x7fffffffd280,
M=...)
    at /opt/kmod_unenc/pyston_deps/llvm-trunk/lib/IR/LegacyPassManager.cpp:1766
#13 0x00000000009004a4 in compileModule (argv=0x7fffffffd698, Context=...) at
/opt/kmod_unenc/pyston_deps/llvm-trunk/tools/llc/llc.cpp:351
#14 0x00000000008ff728 in main (argc=2, argv=0x7fffffffd698) at
/opt/kmod_unenc/pyston_deps/llvm-trunk/tools/llc/llc.cpp:199

Printing out some values in X86RegisterInfo::eliminateFrameIndex():
(gdb) print MI.dump()
  STACKMAP 123, 0, 0, %RSP, 0, ...; mem:LD8[FixedStack0](align=1)
$1 = void
(gdb) print FIOperandNum
$2 = 3
(gdb) print SPAdj
$3 = 0

To repro:
llc t.ll
But it works if you run:
llc t.ll -disable-fp-elim

Tested on r218726</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>