<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 Live Variable Analysis (HandleVirtRegUse) for target bpf"
   href="https://bugs.llvm.org/show_bug.cgi?id=48578">48578</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>crash in Live Variable Analysis (HandleVirtRegUse) for target bpf
          </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>Linux
          </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>-New Bugs
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, 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=24313" name="attach_24313" title="my program (including preprocessed) plus the files that clang told me to include">attachment 24313</a> <a href="attachment.cgi?id=24313&action=edit" title="my program (including preprocessed) plus the files that clang told me to include">[details]</a></span>
my program (including preprocessed) plus the files that clang told me to
include

I've got a program that causes clang to crash (every time) when compiling with
-target bpf. The crash doesn't happen when compiling for x86.

It happens on both clang11 and a recent
trunk(4dce7c2e2092953f2cea1a2c1ffd4a53ec2531ac).

To simply reproduce with the preprocessed source (attached):
clang -O2 -target bpf -c -o probe.bpf.o probe.bpf.preprocessed.c


[andrei:~] clang -g -O2 -target bpf -fcolor-diagnostics -D__TARGET_ARCH_x86
-Ioutput -idirafter /usr/local/include -idirafter
/usr/lib/llvm-11/lib/clang/11.0.0/include -idirafter
/usr/include/x86_64-linux-gnu -idirafter /usr/include -c -o output/probe.bpf.o
probe.bpf.c
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: /usr/bin/clang -g -O2 -target bpf
-fcolor-diagnostics -D__TARGET_ARCH_x86 -Ioutput -idirafter /usr/local/include
-idirafter /usr/lib/llvm-11/lib/clang/11.0.0/include -idirafter
/usr/include/x86_64-linux-gnu -idirafter /usr/include -c -o output/probe.bpf.o
probe.bpf.c 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'probe.bpf.c'.
4.      Running pass 'Live Variable Analysis' on function '@probe'
 #0 0x00007fce4d29dbbf llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xaa6bbf)
 #1 0x00007fce4d29bf20 llvm::sys::RunSignalHandlers()
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xaa4f20)
 #2 0x00007fce4d29d30d llvm::sys::CleanupOnSignal(unsigned long)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xaa630d)
 #3 0x00007fce4d1e5940 (/lib/x86_64-linux-gnu/libLLVM-11.so.1+0x9ee940)
 #4 0x00007fce54356bb0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x14bb0)
 #5 0x00007fce4d51785e llvm::LiveVariables::HandleVirtRegUse(unsigned int,
llvm::MachineBasicBlock*, llvm::MachineInstr&)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xd2085e)
 #6 0x00007fce4d519abe llvm::LiveVariables::runOnInstr(llvm::MachineInstr&,
llvm::SmallVectorImpl<unsigned int>&)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xd22abe)
 #7 0x00007fce4d519ec6
llvm::LiveVariables::runOnBlock(llvm::MachineBasicBlock*, unsigned int)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xd22ec6)
 #8 0x00007fce4d51a4bf
llvm::LiveVariables::runOnMachineFunction(llvm::MachineFunction&)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xd234bf)
 #9 0x00007fce4d570e4e
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xd79e4e)
#10 0x00007fce4d3acc69 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbb5c69)
#11 0x00007fce4d3b2213 llvm::FPPassManager::runOnModule(llvm::Module&)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbbb213)
#12 0x00007fce4d3ad280 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0xbb6280)
#13 0x00007fce52d1c916 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1581916)
#14 0x00007fce52fd9d06 (/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x183ed06)
#15 0x00007fce520a50e3 clang::ParseAST(clang::Sema&, bool, bool)
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x90a0e3)
#16 0x00007fce5366f198 clang::FrontendAction::Execute()
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1ed4198)
#17 0x00007fce53625711
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1e8a711)
#18 0x00007fce536d52d0
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1f3a2d0)
#19 0x00000000004125ff cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/bin/clang+0x4125ff)
#20 0x0000000000410a3e (/usr/bin/clang+0x410a3e)
#21 0x00007fce53359a12 (/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1bbea12)
#22 0x00007fce4d1e574d
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/lib/x86_64-linux-gnu/libLLVM-11.so.1+0x9ee74d)
#23 0x00007fce53358f3f
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
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1bbdf3f)
#24 0x00007fce53330d5f
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1b95d5f)
#25 0x00007fce53330f07
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1b95f07)
#26 0x00007fce53344a6c
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/lib/x86_64-linux-gnu/libclang-cpp.so.11+0x1ba9a6c)
#27 0x00000000004104e3 main (/usr/bin/clang+0x4104e3)
#28 0x00007fce4c2e8cb2 __libc_start_main ./csu/../csu/libc-start.c:314:16
#29 0x000000000040dcde _start (/usr/bin/clang+0x40dcde)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
Ubuntu clang version 11.0.0-2
Target: bpf
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg:</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>