[llvm-bugs] [Bug 41259] switch is not converted into an argument LUT when a call return value is discarded

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 29 07:14:22 PDT 2019


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

Nikita Kniazev <nok.raven at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|REOPENED                    |RESOLVED

--- Comment #9 from Nikita Kniazev <nok.raven at gmail.com> ---
> Probably I am missing something. There is a branch to a non-existing default case, until I explicitly place a `__builtin_unreachable()` in it. This does not happen for the switch with uses. https://godbolt.org/z/hH8geH

Ah, this is invalid. In case when function has the return type and does not
have return statement it is considered unreachable because of UB, and when the
return type is void it cannot assume that it is unreachable.

I am closing this since the fix was recommited in
https://reviews.llvm.org/rL358483.

-- 
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/20190429/a4063eee/attachment.html>


More information about the llvm-bugs mailing list