<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 - wasm code gen assertion failure compiling this file"
   href="https://bugs.llvm.org/show_bug.cgi?id=35151">35151</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>wasm code gen assertion failure compiling this file
          </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>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>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>john@csquare.ca
          </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=19365" name="attach_19365" title="Preprocessed source and run script">attachment 19365</a> <a href="attachment.cgi?id=19365&action=edit" title="Preprocessed source and run script">[details]</a></span>
Preprocessed source and run script

I'm attempting to compile gzip with the trunk clang targeting
wasm32-unknown-unknown-wasm.

clang-6.0: /home/john/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp:65:
std::string llvm::WebAssemblyAsmPrinter::regToString(const llvm::MachineOperand
&): Assertion `!MFI->isVRegStackified(RegNo)' failed.
#0 0x0000000002394bac llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/john/llvm/lib/Support/Unix/Signals.inc:398:0
#1 0x0000000002394d59 PrintStackTraceSignalHandler(void*)
/home/john/llvm/lib/Support/Unix/Signals.inc:462:0
#2 0x0000000002393243 llvm::sys::RunSignalHandlers()
/home/john/llvm/lib/Support/Signals.cpp:50:0
#3 0x00000000023953ef SignalHandler(int)
/home/john/llvm/lib/Support/Unix/Signals.inc:252:0
#4 0x00007f507f5f0330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#5 0x00007f507e196c37 gsignal
/build/eglibc-SvCtMH/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#6 0x00007f507e19a028 abort
/build/eglibc-SvCtMH/eglibc-2.19/stdlib/abort.c:91:0
#7 0x00007f507e18fbf6 __assert_fail_base
/build/eglibc-SvCtMH/eglibc-2.19/assert/assert.c:92:0
#8 0x00007f507e18fca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#9 0x000000000122e15a
llvm::WebAssemblyAsmPrinter::regToString(llvm::MachineOperand const&)
/home/john/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp:66:0
#10 0x000000000122f499
llvm::WebAssemblyAsmPrinter::PrintAsmMemoryOperand(llvm::MachineInstr const*,
unsigned int, unsigned int, char const*, llvm::raw_ostream&)
/home/john/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp:273:0
#11 0x0000000003061b6c EmitGCCInlineAsmStr(char const*, llvm::MachineInstr
const*, llvm::MachineModuleInfo*, int, int, llvm::AsmPrinter*, unsigned int,
llvm::raw_ostream&)
/home/john/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp:431:0
#12 0x0000000003060dcc llvm::AsmPrinter::EmitInlineAsm(llvm::MachineInstr
const*) const
/home/john/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp:508:0
#13 0x0000000003049f31 llvm::AsmPrinter::EmitFunctionBody()
/home/john/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1029:0
#14 0x0000000001230248
llvm::AsmPrinter::runOnMachineFunction(llvm::MachineFunction&)
/home/john/llvm/include/llvm/CodeGen/AsmPrinter.h:279:0
#15 0x000000000122fcf3
llvm::WebAssemblyAsmPrinter::runOnMachineFunction(llvm::MachineFunction&)
/home/john/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.h:49:0
#16 0x00000000016d1d66
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/home/john/llvm/lib/CodeGen/MachineFunctionPass.cpp:62:0
#17 0x0000000001bff43b llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/john/llvm/lib/IR/LegacyPassManager.cpp:1514:0
#18 0x0000000001bff775 llvm::FPPassManager::runOnModule(llvm::Module&)
/home/john/llvm/lib/IR/LegacyPassManager.cpp:1535:0
#19 0x0000000001bfff6f (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/john/llvm/lib/IR/LegacyPassManager.cpp:1591:0
#20 0x0000000001bffa5b llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/john/llvm/lib/IR/LegacyPassManager.cpp:1694:0
#21 0x0000000001c004b1 llvm::legacy::PassManager::run(llvm::Module&)
/home/john/llvm/lib/IR/LegacyPassManager.cpp:1725:0
#22 0x00000000026bef23 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
/home/john/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:794:0
#23 0x00000000026bc56f 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> >)
/home/john/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:1145:0
#24 0x0000000003470131
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/home/john/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:292:0
#25 0x0000000004550c50 clang::ParseAST(clang::Sema&, bool, bool)
/home/john/llvm/tools/clang/lib/Parse/ParseAST.cpp:161:0
#26 0x0000000002e6a98e clang::ASTFrontendAction::ExecuteAction()
/home/john/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:1000:0
#27 0x000000000346d4f7 clang::CodeGenAction::ExecuteAction()
/home/john/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1032:0
#28 0x0000000002e6a3c8 clang::FrontendAction::Execute()
/home/john/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:901:0
#29 0x0000000002df5aa4
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/john/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:992:0
#30 0x0000000002fef93e
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/john/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#31 0x0000000000dbf01c cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /home/john/llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#32 0x0000000000db1e31 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) /home/john/llvm/tools/clang/tools/driver/driver.cpp:309:0
#33 0x0000000000db0ab1 main
/home/john/llvm/tools/clang/tools/driver/driver.cpp:388:0
#34 0x00007f507e181f45 __libc_start_main
/build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:321:0
#35 0x0000000000daf874 _start (/usr/local/bin/clang-6.0+0xdaf874)
Stack dump:
0.      Program arguments: /usr/local/bin/clang-6.0 -cc1 -triple
wasm32-unknown-unknown-wasm -emit-obj -mrelax-all -disable-free -main-file-name
printf-frexpl.c -mrelocation-model static -mthread-model posix -masm-verbose
-mconstructor-aliases -fuse-init-array -target-cpu generic -fvisibility hidden
-dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer
-ffunction-sections -fdata-sections -coverage-notes-file
/home/john/repos/gzip/lib/printf-frexpl.gcno -nobuiltininc -resource-dir
/usr/local/lib/clang/6.0.0 -dependency-file .deps/printf-frexpl.Tpo
-sys-header-deps -MP -MT printf-frexpl.o -D HAVE_CONFIG_H -I . -isysroot
/home/john/wasm_sysroot/ -internal-isystem /home/john/wasm_sysroot//include -W
-Wabi -Waddress -Wall -Wattributes -Wbad-function-cast
-Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wcomment -Wcomments
-Wcpp -Wdangling-else -Wdate-time -Wdeprecated -Wdeprecated-declarations
-Wdisabled-optimization -Wdiv-by-zero -Wdouble-promotion
-Wduplicate-decl-specifier -Wempty-body -Wendif-labels -Wenum-compare
-Wexpansion-to-defined -Wextra -Wformat-extra-args -Wformat-security
-Wformat-y2k -Wformat-zero-length -Wignored-attributes -Wignored-qualifiers
-Wimplicit -Wimplicit-function-declaration -Wimplicit-int
-Wincompatible-pointer-types -Winit-self -Wint-conversion -Wint-to-pointer-cast
-Winvalid-pch -Wlogical-not-parentheses -Wmain -Wmissing-braces
-Wmissing-declarations -Wmissing-field-initializers -Wmissing-include-dirs
-Wmultichar -Wnarrowing -Wnonnull -Wnull-dereference -Wodr -Woverflow
-Woverlength-strings -Wpacked -Wparentheses -Wpointer-arith -Wpointer-sign
-Wpointer-to-int-cast -Wpragmas -Wreturn-type -Wsequence-point
-Wshift-count-negative -Wshift-count-overflow -Wshift-negative-value
-Wsizeof-array-argument -Wsizeof-pointer-memaccess -Wstrict-aliasing
-Wstrict-prototypes -Wswitch -Wswitch-bool -Wtautological-compare -Wtrigraphs
-Wtype-limits -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label
-Wunused-local-typedefs -Wunused-parameter -Wunused-result -Wunused-value
-Wunused-variable -Wvarargs -Wvariadic-macros -Wvolatile-register-var
-Wwrite-strings -Wno-sign-compare -Wno-unused-parameter -Wno-format-nonliteral
-Werror -fconst-strings -fdebug-compilation-dir /home/john/repos/gzip/lib
-ferror-limit 19 -fmessage-length 120 -fobjc-runtime=gnustep -fno-common
-fdiagnostics-show-option -fcolor-diagnostics -o printf-frexpl.o -x c
printf-frexpl.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'printf-frexpl.c'.
4.      Running pass 'WebAssembly Assembly Printer' on function
'@printf_frexpl'
clang-6.0: error: unable to execute command: Aborted (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (trunk 316824)
Target: wasm32-unknown-unknown-wasm
Thread model: posix
InstalledDir: /usr/local/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang-6.0: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-6.0: note: diagnostic msg: /tmp/printf-frexpl-50b01f.c
clang-6.0: note: diagnostic msg: /tmp/printf-frexpl-50b01f.sh
clang-6.0: 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>