<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 - Using "long double" as asm register in x86_64 crashes llc"
   href="https://bugs.llvm.org/show_bug.cgi?id=45914">45914</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Using "long double" as asm register in x86_64 crashes llc
          </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>dgreenaway@google.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>When compiled with the command:

    clang++ -O0 ./source.cc

clang crashes attempting to compile the following code on x86-64:

    long double a;
    void b() { __asm__("" : "=r"(a)); }

when I would instead expect an error message, such as "couldn't allocate output
register".

Possible duplicate of <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - llc crashes instead of giving an error message when inline assembly references an illegal register"
   href="show_bug.cgi?id=26353">bug 26353</a>.


Output of clang:

---

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: /opt/compiler-explorer/clang-trunk/bin/clang++ -g -o
./output.s -mllvm --x86-asm-syntax=intel -S
--gcc-toolchain=/opt/compiler-explorer/gcc-9.2.0 -fcolor-diagnostics
-fno-crash-diagnostics -O0 <source> 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module '<source>'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@_Z1bv'
 #0 0x0000561c0339e14a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2bce14a)
 #1 0x0000561c0339bf14 llvm::sys::RunSignalHandlers()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2bcbf14)
 #2 0x0000561c0339c185 llvm::sys::CleanupOnSignal(unsigned long)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2bcc185)
 #3 0x0000561c03314720 CrashRecoverySignalHandler(int)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2b44720)
 #4 0x00007f5f1fd16890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #5 0x0000561c02b36a24 llvm::EVT::isExtendedVector() const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2366a24)
 #6 0x0000561c01ffad43
llvm::TargetLoweringBase::getNumRegisters(llvm::LLVMContext&, llvm::EVT) const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x182ad43)
 #7 0x0000561c03fe40dd llvm::SelectionDAGBuilder::visitInlineAsm(llvm::CallBase
const&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x38140dd)
 #8 0x0000561c03fcd345 llvm::SelectionDAGBuilder::visitCall(llvm::CallInst
const&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x37fd345)
 #9 0x0000561c03ff4c4a llvm::SelectionDAGBuilder::visit(llvm::Instruction
const&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3824c4a)
#10 0x0000561c0403fb21
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,
false, false, void>, false, true>,
llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, false,
false, void>, false, true>, bool&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x386fb21)
#11 0x0000561c04043c0b
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3873c0b)
#12 0x0000561c04045a8d
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(.part.812) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3875a8d)
#13 0x0000561c0236f232 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x1b9f232)
#14 0x0000561c02949720
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2179720)
#15 0x0000561c02cf96bf llvm::FPPassManager::runOnFunction(llvm::Function&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x25296bf)
#16 0x0000561c02cf9db1 llvm::FPPassManager::runOnModule(llvm::Module&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2529db1)
#17 0x0000561c02cfa1b1 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x252a1b1)
#18 0x0000561c03613828 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2e43828)
#19 0x0000561c036153ea 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> >)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2e453ea)
#20 0x0000561c0413babc
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x396babc)
#21 0x0000561c04e39269 clang::ParseAST(clang::Sema&, bool, bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x4669269)
#22 0x0000561c03b71839 clang::FrontendAction::Execute()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x33a1839)
#23 0x0000561c03b2cb03
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x335cb03)
#24 0x0000561c03c35d4b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3465d4b)
#25 0x0000561c015fce8c cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0xe2ce8c)
#26 0x0000561c015f9abd ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0xe29abd)
#27 0x0000561c03a07455 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::'lambda'()>(long)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3237455)
#28 0x0000561c03314803
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2b44803)
#29 0x0000561c03a080c0
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 (.part.152)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x32380c0)
#30 0x0000561c039e28c5
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x32128c5)
#31 0x0000561c039e330f
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x321330f)
#32 0x0000561c039ebe15
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x321be15)
#33 0x0000561c0153e020 main
(/opt/compiler-explorer/clang-trunk/bin/clang+++0xd6e020)
#34 0x00007f5f1ebd4b97 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b97)
#35 0x0000561c015f963a _start
(/opt/compiler-explorer/clang-trunk/bin/clang+++0xe2963a)
clang-11: error: clang frontend command failed due to signal (use -v to see
invocation)
Compiler returned: 254</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>