<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 - [coroutines] ICE "Pass 'Coroutine Elision' is not initialized" with -fcoroutines-ts -O0"
   href="https://bugs.llvm.org/show_bug.cgi?id=33226">33226</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[coroutines] ICE "Pass 'Coroutine Elision' is not initialized" with -fcoroutines-ts -O0
          </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>All
          </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>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>eniebler@boost.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Repro steps (with trunk latest on a Mac):

<span class="quote">> mkdir ~/llvm-build</span >

<span class="quote">> cd ~/llvm-build</span >

# -DLLVM_TARGETS_TO_BUILD='X86' seems to matter here:
<span class="quote">> cmake -DCMAKE_INSTALL_PREFIX:PATH=~/llvm-install -DCMAKE_BUILD_TYPE:STRING=Release -DLLVM_TARGETS_TO_BUILD='X86' ~/llvm</span >

<span class="quote">> make && make install</span >

# Any empty input file will do
<span class="quote">> echo // comment > test.cpp</span >

<span class="quote">> ~/llvm-install/bin/clang++ -fcoroutines-ts -O0 -c test.cpp</span >

Result:

eniebler-mbp:llvm-ninja eniebler$ ~/llvm-install/bin/clang++ -fcoroutines-ts
-O0 -c test.cpp
Pass 'Coroutine Elision' is not initialized.
Verify if there is a pass dependency cycle.
Required Passes:
0  clang-5.0                0x000000010ac06808
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  clang-5.0                0x000000010ac06e76 SignalHandler(int) + 342
2  libsystem_platform.dylib 0x00007fffbca5eb3a _sigtramp + 26
3  clang-5.0                0x000000010c8f3ba8 (anonymous
namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int)
const::CU64BitRegs + 132176
4  clang-5.0                0x000000010b432c54
addCoroutineOpt0Passes(llvm::PassManagerBuilder const&,
llvm::legacy::PassManagerBase&) + 52
5  clang-5.0                0x000000010a82a573
llvm::PassManagerBuilder::addExtensionsToPM(llvm::PassManagerBuilder::ExtensionPointTy,
llvm::legacy::PassManagerBase&) const + 307
6  clang-5.0                0x000000010a82b4a2
llvm::PassManagerBuilder::populateModulePassManager(llvm::legacy::PassManagerBase&)
+ 770
7  clang-5.0                0x000000010adafc53
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions
const&, clang::CodeGenOptions const&, clang::TargetOptions const&,
clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*,
clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream,
std::__1::default_delete<llvm::raw_pwrite_stream> >) + 13123
8  clang-5.0                0x000000010af580c9
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 889
9  clang-5.0                0x000000010b7e7405 clang::ParseAST(clang::Sema&,
bool, bool) + 469
10 clang-5.0                0x000000010b1788a3 clang::FrontendAction::Execute()
+ 67
11 clang-5.0                0x000000010b1366e8
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1080
12 clang-5.0                0x000000010b1bb1de
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 5326
13 clang-5.0                0x000000010a094cfc cc1_main(llvm::ArrayRef<char
const*>, char const*, void*) + 1196
14 clang-5.0                0x000000010a093b60 main + 12096
15 libdyld.dylib            0x00007fffbc84f235 start + 1
Stack dump:
0.      Program arguments: /Users/eniebler/llvm-install/bin/clang-5.0 -cc1
-triple x86_64-apple-macosx10.12.0 -Wdeprecated-objc-isa-usage
-Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -discard-value-names -main-file-name test.cpp
-mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim
-masm-verbose -munwind-tables -target-cpu penryn -target-linker-version 274.1
-dwarf-column-info -debugger-tuning=lldb -coverage-notes-file
/Users/eniebler/llvm-ninja/test.gcno -resource-dir
/Users/eniebler/llvm-install/lib/clang/5.0.0 -stdlib=libc++ -O0
-fdeprecated-macro -fdebug-compilation-dir /Users/eniebler/llvm-ninja
-ferror-limit 19 -fmessage-length 247 -stack-protector 1 -fblocks
-fcoroutines-ts -fobjc-runtime=macosx-10.12.0 -fencode-extended-block-signature
-fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option
-fcolor-diagnostics -o test.o -x c++ test.cpp
1.      <eof> parser at end of file
clang-5.0: error: unable to execute command: Segmentation fault: 11
clang-5.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 5.0.0 (<a href="http://llvm.org/git/clang.git">http://llvm.org/git/clang.git</a>
1c50ce32c7bb476416a210cfbcbb5e934c266538) (<a href="http://llvm.org/git/llvm.git">http://llvm.org/git/llvm.git</a>
f0c3d71794d1695efe08bdf83c6b1824dcf07c80)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: /Users/eniebler/llvm-install/bin
clang-5.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-5.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-5.0: note: diagnostic msg:
/var/folders/0_/77jy5prn181b5wn2xzl1cbfc18wy7r/T/test-a028ed.cpp
clang-5.0: note: diagnostic msg:
/var/folders/0_/77jy5prn181b5wn2xzl1cbfc18wy7r/T/test-a028ed.sh
clang-5.0: note: diagnostic msg: Crash backtrace is located in
clang-5.0: note: diagnostic msg:
/Users/eniebler/Library/Logs/DiagnosticReports/clang-5.0_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang-5.0: note: diagnostic msg: (choose the .crash file that corresponds to
your crash)
clang-5.0: note: diagnostic msg:

********************


Crashes with -O0, no crash with -O1.</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>