[llvm-bugs] [Bug 46501] New: Loop with optimiser crashes simple coroutines

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 29 07:23:14 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46501

            Bug ID: 46501
           Summary: Loop with optimiser crashes simple coroutines
           Product: clang
           Version: 10.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: wyattth at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

Created attachment 23655
  --> https://bugs.llvm.org/attachment.cgi?id=23655&action=edit
Short main.cpp shows simplified problem code

A simple loop (even one round only) will crash the LLVM frontend if it contains
a coroutine co_await. So...

A f() {
    for (int i=0; i<1; i++) 
    {
        co_await suspend_always{};
    }
}

...crashes the llvm front-end (I believe) when used with -Os or -O2, but the
following code (with the for statement removed) works fine:

A f() {
    co_await suspend_always{};
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200629/72917fd0/attachment-0001.html>


More information about the llvm-bugs mailing list