[llvm-bugs] [Bug 31597] New: Crash/assert when using regalloc= with -O0

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jan 10 07:17:40 PST 2017


https://llvm.org/bugs/show_bug.cgi?id=31597

            Bug ID: 31597
           Summary: Crash/assert when using regalloc= with -O0
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: llc
          Assignee: unassignedbugs at nondot.org
          Reporter: jonathanchesterfield at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Repro:

echo "define i32 @main() { ret i32 0 }" | llc -O0 --regalloc=basic
echo "define i32 @main() { ret i32 0 }" | llc -O0 --regalloc=greedy
echo "define i32 @main() { ret i32 0 }" | llc -O0 --regalloc=pbqp

Any of these cause a segfault on release builds of 3.9 and trunk. On a debug
build of trunk an assertion fires, stack trace below.

Older versions of llvm (checked 3.5 and 3.8) print "LLVM ERROR: regalloc=...
not currently supported with -O0"

This was discovered while debugging a probably unrelated issue in the fast
allocator when I tried to compare it with the basic allocator. Ideally the
allocators would all work correctly at O0, but failing that perhaps we should
reinstate the error message at O0.

Cheers

    .text
    .file    "<stdin>"
MachineFunctionProperties required by X86 FP Stackifier pass are not met by
function main.
Required properties: NoVRegs
Current properties: NoPHIs, TracksLiveness
MachineFunctionProperties check failed
UNREACHABLE executed at
/home/jon/trunk/llvm/lib/CodeGen/MachineFunctionPass.cpp:58!
#0 0x0000000002b18a53 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/jon/trunk/llvm/lib/Support/Unix/Signals.inc:402:0
#1 0x0000000002b18e15 PrintStackTraceSignalHandler(void*)
/home/jon/trunk/llvm/lib/Support/Unix/Signals.inc:466:0
#2 0x0000000002b17072 llvm::sys::RunSignalHandlers()
/home/jon/trunk/llvm/lib/Support/Signals.cpp:44:0
#3 0x0000000002b183e5 SignalHandler(int)
/home/jon/trunk/llvm/lib/Support/Unix/Signals.inc:256:0
#4 0x00007f89c8a9c7e0 __restore_rt (/lib64/libpthread.so.0+0xf7e0)
#5 0x00007f89c77485e5 __GI_raise (/lib64/libc.so.6+0x325e5)
#6 0x00007f89c7749dc5 __GI_abort (/lib64/libc.so.6+0x33dc5)
#7 0x0000000002aa66b6 bindingsErrorHandler(void*, std::string const&, bool)
/home/jon/trunk/llvm/lib/Support/ErrorHandling.cpp:127:0
#8 0x0000000002277517 llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/home/jon/trunk/llvm/lib/CodeGen/MachineFunctionPass.cpp:62:0
#9 0x00000000025fa128 llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/jon/trunk/llvm/lib/IR/LegacyPassManager.cpp:1513:0
#10 0x00000000025fa2bb llvm::FPPassManager::runOnModule(llvm::Module&)
/home/jon/trunk/llvm/lib/IR/LegacyPassManager.cpp:1534:0
#11 0x00000000025fa647 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/jon/trunk/llvm/lib/IR/LegacyPassManager.cpp:1590:0
#12 0x00000000025fad38 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/jon/trunk/llvm/lib/IR/LegacyPassManager.cpp:1693:0
#13 0x00000000025faf79 llvm::legacy::PassManager::run(llvm::Module&)
/home/jon/trunk/llvm/lib/IR/LegacyPassManager.cpp:1725:0
#14 0x0000000000fbcbf5 compileModule(char**, llvm::LLVMContext&)
/home/jon/trunk/llvm/tools/llc/llc.cpp:530:0
#15 0x0000000000fbb311 main /home/jon/trunk/llvm/tools/llc/llc.cpp:285:0
#16 0x00007f89c7734d1d __libc_start_main (/lib64/libc.so.6+0x1ed1d)
#17 0x0000000000fb9551 _start (./llc+0xfb9551)
Stack dump:
0.    Program arguments: ./llc -O0 --regalloc=basic
1.    Running pass 'Function Pass Manager' on module '<stdin>'.
2.    Running pass 'X86 FP Stackifier' on function '@main'
Aborted

-- 
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/20170110/f7143d0b/attachment-0001.html>


More information about the llvm-bugs mailing list