[llvm-bugs] [Bug 42897] LLVM optimizer eliminates zero check if return statement is missing

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 6 06:53:25 PDT 2019


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

Tim Northover <t.p.northover at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID
                 CC|                            |t.p.northover at gmail.com

--- Comment #3 from Tim Northover <t.p.northover at gmail.com> ---
Undefined behaviour like this frequently results in unexpected outcomes.

If you really want less aggressive optimizations in this case then there's a
-fno-strict-return option that will help, though it doesn't cover all cases for
some pretty good reasons (see https://reviews.llvm.org/D27163).


But fixing warnings is probably the best plan.

-- 
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/20190806/e5608ef4/attachment-0001.html>


More information about the llvm-bugs mailing list