[llvm-bugs] [Bug 35658] New: Crash in CodeGenPRepare with enabled complex addr modes

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Dec 14 02:13:33 PST 2017


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

            Bug ID: 35658
           Summary: Crash in CodeGenPRepare with enabled complex addr
                    modes
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: mikael.holmen at ericsson.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 19547
  --> https://bugs.llvm.org/attachment.cgi?id=19547&action=edit
reproducer

llc -O1 -o - reduced.ll -march=x86

on the attached ll file crashes with

        .text
        .file   "reduced.ll"
llc: ../include/llvm/Support/Casting.h:106: static bool
llvm::isa_impl_cl<llvm::Operator, const llvm::Value *>::doit(const From *) [To
= llvm::Operator, From = const llvm::Value *]: Assertion `Val && "isa<> used on
a null pointer"' failed.
#0 0x0000000001e0fa44 PrintStackTraceSignalHandler(void*)
(../llvm-patch/build-all/bin/llc+0x1e0fa44)
#1 0x0000000001e101b6 SignalHandler(int)
(../llvm-patch/build-all/bin/llc+0x1e101b6)
#2 0x00007fb8ea15b330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#3 0x00007fb8e8d4ac37 gsignal
/build/eglibc-SvCtMH/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#4 0x00007fb8e8d4e028 abort
/build/eglibc-SvCtMH/eglibc-2.19/stdlib/abort.c:91:0
#5 0x00007fb8e8d43bf6 __assert_fail_base
/build/eglibc-SvCtMH/eglibc-2.19/assert/assert.c:92:0
#6 0x00007fb8e8d43ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#7 0x00000000014270fc computeKnownBitsFromOperator(llvm::Operator const*,
llvm::KnownBits&, unsigned int, (anonymous namespace)::Query const&)
(../llvm-patch/build-all/bin/llc+0x14270fc)
#8 0x0000000001410831 computeKnownBits(llvm::Value const*, llvm::KnownBits&,
unsigned int, (anonymous namespace)::Query const&)
(../llvm-patch/build-all/bin/llc+0x1410831)
#9 0x0000000001424b00 computeKnownBitsFromOperator(llvm::Operator const*,
llvm::KnownBits&, unsigned int, (anonymous namespace)::Query const&)
(../llvm-patch/build-all/bin/llc+0x1424b00)
#10 0x0000000001410831 computeKnownBits(llvm::Value const*, llvm::KnownBits&,
unsigned int, (anonymous namespace)::Query const&)
(../llvm-patch/build-all/bin/llc+0x1410831)
#11 0x0000000001410b71 llvm::computeKnownBits(llvm::Value const*,
llvm::DataLayout const&, unsigned int, llvm::AssumptionCache*,
llvm::Instruction const*, llvm::DominatorTree const*,
llvm::OptimizationRemarkEmitter*) (../llvm-patch/build-all/bin/llc+0x1410b71)
#12 0x000000000135417b llvm::SimplifyInstruction(llvm::Instruction*,
llvm::SimplifyQuery const&, llvm::OptimizationRemarkEmitter*)
(../llvm-patch/build-all/bin/llc+0x135417b)
#13 0x00000000014cf96d (anonymous
namespace)::AddressingModeCombiner::combineAddrModes()
(../llvm-patch/build-all/bin/llc+0x14cf96d)
#14 0x00000000014ca824 (anonymous
namespace)::CodeGenPrepare::optimizeMemoryInst(llvm::Instruction*,
llvm::Value*, llvm::Type*, unsigned int)
(../llvm-patch/build-all/bin/llc+0x14ca824)
#15 0x00000000014c7a2b (anonymous
namespace)::CodeGenPrepare::optimizeInst(llvm::Instruction*, bool&)
(../llvm-patch/build-all/bin/llc+0x14c7a2b)
#16 0x00000000014bbfb0 (anonymous
namespace)::CodeGenPrepare::runOnFunction(llvm::Function&)
(../llvm-patch/build-all/bin/llc+0x14bbfb0)
#17 0x000000000188d6d8 llvm::FPPassManager::runOnFunction(llvm::Function&)
(../llvm-patch/build-all/bin/llc+0x188d6d8)
#18 0x000000000188d918 llvm::FPPassManager::runOnModule(llvm::Module&)
(../llvm-patch/build-all/bin/llc+0x188d918)
#19 0x000000000188ddf5 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(../llvm-patch/build-all/bin/llc+0x188ddf5)
#20 0x00000000006cf86f compileModule(char**, llvm::LLVMContext&)
(../llvm-patch/build-all/bin/llc+0x6cf86f)
#21 0x00000000006ccfbb main (../llvm-patch/build-all/bin/llc+0x6ccfbb)
#22 0x00007fb8e8d35f45 __libc_start_main
/build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:321:0
#23 0x00000000006ca7bd _start (../llvm-patch/build-all/bin/llc+0x6ca7bd)
Stack dump:
0.      Program arguments: ../llvm-patch/build-all/bin/llc -O1 -o - reduced.ll
-march=x86 
1.      Running pass 'Function Pass Manager' on module 'reduced.ll'.
2.      Running pass 'CodeGen Prepare' on function '@f2'
Abort

With -disable-complex-addr-modes=1 it doesn't crash and we get some output.

The default value of -disable-complex-addr-modes was changed to 0 in commit
r319302 and it crashed on the above input then too.

-- 
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/20171214/2c62e47f/attachment.html>


More information about the llvm-bugs mailing list