<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 - Assertion `isReg() && "This is not a register operand!"' failed." for Hexagon after 47633af9d4a8b93f50cb711cf23489736e0226f1"
   href="https://bugs.llvm.org/show_bug.cgi?id=51229">51229</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion `isReg() && "This is not a register operand!"' failed." for Hexagon after 47633af9d4a8b93f50cb711cf23489736e0226f1
          </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>Windows NT
          </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>DebugInfo
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>natechancellor@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>jdevlieghere@apple.com, keith.walker@arm.com, llvm-bugs@lists.llvm.org, paul_robinson@playstation.sony.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When building the 5.10 Linux kernel for Hexagon, there is a crash in
net/core/dev.c:

$ make -skj"$(nproc)" ARCH=hexagon CROSS_COMPILE=hexagon-linux- LLVM=1
LLVM_IAS=1 distclean defconfig net/core/dev.o
...
clang:
/home/nathan/cbl/tc-build/llvm-project/llvm/include/llvm/CodeGen/MachineOperand.h:361:
llvm::Register llvm::MachineOperand::getReg() const: Assertion `isReg() &&
"This is not a register operand!"' failed.
...

I bisected this to
<a href="https://github.com/llvm/llvm-project/commit/47633af9d4a8b93f50cb711cf23489736e0226f1">https://github.com/llvm/llvm-project/commit/47633af9d4a8b93f50cb711cf23489736e0226f1</a>
and cvise'd the following reproducer:

$ cat dev.i
struct netdev_queue {
  int sb_dev
} * netdev_get_tx_queue_dev;
netdev_bind_sb_channel_queue_sb_dev;
short netdev_bind_sb_channel_queue_offset;
struct netdev_queue *netdev_get_tx_queue(index) {
  return &netdev_get_tx_queue_dev[index];
}
netdev_bind_sb_channel_queue(unsigned short count) {
  while (count--)
    netdev_get_tx_queue(count + netdev_bind_sb_channel_queue_offset)->sb_dev =
        netdev_bind_sb_channel_queue_sb_dev;
}

$ clang -fno-strict-aliasing -g -O2 --target=hexagon-linux -c -o /dev/null
dev.i
...
clang:
/home/nathan/cbl/github/tc-build/llvm-project/llvm/include/llvm/CodeGen/MachineOperand.h:361:
llvm::Register llvm::MachineOperand::getReg() const: Assertion `isReg() &&
"This is not a register operand!"' failed.
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang -fno-strict-aliasing -g -O2
--target=hexagon-linux -c -o /dev/null dev.i
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'dev.i'.
4.      Running pass 'Hexagon Hardware Loops' on function
'@netdev_bind_sb_channel_queue'
 #0 0x000000000306fd63 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x306fd63)
 #1 0x000000000306dbae llvm::sys::RunSignalHandlers()
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x306dbae)
 #2 0x0000000002ff77c3 (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
CrashRecoveryContext.cpp:0:0
 #3 0x0000000002ff793e CrashRecoverySignalHandler(int)
CrashRecoveryContext.cpp:0:0
 #4 0x00007f0b49de1870 __restore_rt sigaction.c:0:0
 #5 0x00007f0b4989bd22 raise (/usr/lib/libc.so.6+0x3cd22)
 #6 0x00007f0b49885862 abort (/usr/lib/libc.so.6+0x26862)
 #7 0x00007f0b49885747 _nl_load_domain.cold loadmsgcat.c:0:0
 #8 0x00007f0b49894616 (/usr/lib/libc.so.6+0x35616)
 #9 0x00000000023c9a1e
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x23c9a1e)
#10 0x0000000001c43490 (anonymous
namespace)::HexagonHardwareLoops::convertToHardwareLoop(llvm::MachineLoop*,
bool&, bool&) HexagonHardwareLoops.cpp:0:0
#11 0x0000000001c40eba (anonymous
namespace)::HexagonHardwareLoops::runOnMachineFunction(llvm::MachineFunction&)
HexagonHardwareLoops.cpp:0:0
#12 0x00000000023a9f2d
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x23a9f2d)
#13 0x000000000283e548 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x283e548)
#14 0x0000000002846a11 llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x2846a11)
#15 0x000000000283f041 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x283f041)
#16 0x000000000376040f (anonymous
namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >) BackendUtil.cpp:0:0
#17 0x000000000375ab7c clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef,
llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x375ab7c)
#18 0x0000000003a946c0
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
CodeGenAction.cpp:0:0
#19 0x00000000041ad984 clang::ParseAST(clang::Sema&, bool, bool)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x41ad984)
#20 0x00000000039e88a0 clang::FrontendAction::Execute()
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x39e88a0)
#21 0x000000000395bb7f
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x395bb7f)
#22 0x0000000003a8e747
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x3a8e747)
#23 0x0000000001b55578 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x1b55578)
#24 0x0000000001b530cd ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#25 0x00000000037fdc02 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
<span class="quote">>, std::__cxx11::basic_string<char, std::char_traits<char>,</span >
std::allocator<char> >*, bool*) const::$_1>(long) Job.cpp:0:0
#26 0x0000000002ff76d7
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x2ff76d7)
#27 0x00000000037fd767
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
<span class="quote">>, std::__cxx11::basic_string<char, std::char_traits<char>,</span >
std::allocator<char> >*, bool*) const
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x37fd767)
#28 0x00000000037c59f8
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x37c59f8)
#29 0x00000000037c5cc7
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x37c5cc7)
#30 0x00000000037de391
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x37de391)
#31 0x0000000001b52996 main
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x1b52996)
#32 0x00007f0b49886b25 __libc_start_main (/usr/lib/libc.so.6+0x27b25)
#33 0x0000000001b4fd3e _start
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x1b4fd3e)
clang-13: error: clang frontend command failed with exit code 134 (use -v to
see invocation)
ClangBuiltLinux clang version 13.0.0 (<a href="https://github.com/llvm/llvm-project">https://github.com/llvm/llvm-project</a>
47633af9d4a8b93f50cb711cf23489736e0226f1)
Target: hexagon-unknown-linux
Thread model: posix
InstalledDir: /home/nathan/cbl/github/tc-build/build/llvm/stage1/bin
clang-13: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.</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>