[llvm-bugs] [Bug 39986] New: unused exception_ptr optimization

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Dec 12 21:37:10 PST 2018


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

            Bug ID: 39986
           Summary: unused exception_ptr optimization
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: trass3r at gmail.com
                CC: llvm-bugs at lists.llvm.org

https://godbolt.org/z/oQRbPa

#include <exception>
#include <stdexcept>

void handle_eptr(std::exception_ptr eptr)
{
    if (eptr)
        std::rethrow_exception(eptr);
}

int main()
{
    std::exception_ptr eptr;
    handle_eptr(eptr);
}

$ clang++ -stdlib=libc++ -std=c++17 -O3 -fno-exceptions

I'm not sure if it's possible but the expectation is that it should generally
optimize all the code away, especially with -fno-exceptions.

It came up when testing coroutines with the cppcoro lib:
https://godbolt.org/z/u-vaoR

-- 
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/20181213/c810c966/attachment.html>


More information about the llvm-bugs mailing list