[llvm-bugs] [Bug 42047] -Ofast produces infinite loop

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 28 07:57:51 PDT 2019


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

Anton Korobeynikov <anton at korobeynikov.info> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anton at korobeynikov.info
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Anton Korobeynikov <anton at korobeynikov.info> ---
The code has undefined behavior because it relies on signed integer overflow.
If you'd compile with -fsanitize=undefined, then it will clearly report it to
you:

1.c:8:15: runtime error: signed integer overflow: 1162261467 * 3 cannot be
represented in type 'int'

-- 
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/20190528/d82b9e7e/attachment.html>


More information about the llvm-bugs mailing list