<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 - Not supported instr: <MCInst 0 <MCOperand Reg:227> <MCOperand Reg:226> <MCOperand Expr:(LBB0_2)>>"
   href="https://bugs.llvm.org/show_bug.cgi?id=48997">48997</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Not supported instr: <MCInst 0 <MCOperand Reg:227> <MCOperand Reg:226> <MCOperand Expr:(LBB0_2)>>
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dennis.frett@live.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24473" name="attach_24473" title="reduced.ll">attachment 24473</a> <a href="attachment.cgi?id=24473&action=edit" title="reduced.ll">[details]</a></span>
reduced.ll

When compiling the attached bitcode file with O0, I get:

Not supported instr: <MCInst 0 <MCOperand Reg:227> <MCOperand Reg:226>
<MCOperand Expr:(LBB0_2)>>

To reproduce:
llc reduced.ll --filetype=obj -O0

or

clang -cc1 -x ir reduced.ll -o out -triple arm64-apple-ios8.0.0 -emit-obj -O0

- Emitting for macOS (x86_64-apple-darwin20.2.0) works without a problem.
- Emitting with non-O0 optimisation level works without a problem.

llc backtrace:
LLVM ERROR: Not supported instr: <MCInst 0 <MCOperand Reg:227> <MCOperand
Reg:226> <MCOperand Expr:(LBB0_2)>>
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace.
Stack dump:
0.      Program arguments: llc reduced.ll --filetype=obj -O0
1.      Running pass 'Function Pass Manager' on module 'reduced.ll'.
2.      Running pass 'AArch64 Assembly Printer' on function '@MyFunction'
0  libLLVM.dylib            0x000000010ae0f4d5
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  libLLVM.dylib            0x000000010ae0f97c SignalHandler(int) + 200
2  libsystem_platform.dylib 0x00007fff20374d7d _sigtramp + 29
3  libLLVM.dylib            0x000000010e79a920 _dyld_private + 0
4  libsystem_c.dylib        0x00007fff20283720 abort + 120
5  libLLVM.dylib            0x000000010ad85e51
llvm::report_fatal_error(llvm::Twine const&, bool) + 270
6  libLLVM.dylib            0x000000010ad85eb0
llvm::report_fatal_error(llvm::StringRef, bool) + 0
7  libLLVM.dylib            0x000000010bf6ac4b (anonymous
namespace)::AArch64MCCodeEmitter::getBinaryCodeForInstr(llvm::MCInst const&,
llvm::SmallVectorImpl<llvm::MCFixup>&, llvm::MCSubtargetInfo const&) const +
29319
8  libLLVM.dylib            0x000000010bf639aa (anonymous
namespace)::AArch64MCCodeEmitter::encodeInstruction(llvm::MCInst const&,
llvm::raw_ostream&, llvm::SmallVectorImpl<llvm::MCFixup>&,
llvm::MCSubtargetInfo const&) const + 90
9  libLLVM.dylib            0x000000010badc782 (anonymous
namespace)::MCMachOStreamer::emitInstToData(llvm::MCInst const&,
llvm::MCSubtargetInfo const&) + 142
10 libLLVM.dylib            0x000000010bae2216
llvm::MCObjectStreamer::emitInstruction(llvm::MCInst const&,
llvm::MCSubtargetInfo const&) + 240
11 libLLVM.dylib            0x000000010be53ed7 (anonymous
namespace)::AArch64AsmPrinter::emitInstruction(llvm::MachineInstr const*) +
5991
12 libLLVM.dylib            0x000000010b31de22
llvm::AsmPrinter::emitFunctionBody() + 1904
13 libLLVM.dylib            0x000000010be50c0a (anonymous
namespace)::AArch64AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) +
180
14 libLLVM.dylib            0x000000010b01a3e7
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 239
15 libLLVM.dylib            0x000000010aed605e
llvm::FPPassManager::runOnFunction(llvm::Function&) + 536
16 libLLVM.dylib            0x000000010aed9a7a
llvm::FPPassManager::runOnModule(llvm::Module&) + 52
17 libLLVM.dylib            0x000000010aed64de
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 684
18 llc                      0x0000000108a3d49e compileModule(char**,
llvm::LLVMContext&) + 5956
19 llc                      0x0000000108a3b978 main + 1273
20 libdyld.dylib            0x00007fff2034b621 start + 1
21 libdyld.dylib            0x0000000000000004 start + 18446603339975838180</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>