<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Crash in CodeGenPRepare with enabled complex addr modes"
   href="https://bugs.llvm.org/show_bug.cgi?id=35658">35658</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash in CodeGenPRepare with enabled complex addr modes
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mikael.holmen@ericsson.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=19547" name="attach_19547" title="reproducer">attachment 19547</a> <a href="attachment.cgi?id=19547&action=edit" title="reproducer">[details]</a></span>
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.</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>