[llvm-bugs] [Bug 37774] Incorrect result at self-comparison of uninitialized value

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 12 15:35:55 PDT 2018


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

rtrieu at google.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
                 CC|                            |rtrieu at google.com
             Status|NEW                         |RESOLVED

--- Comment #1 from rtrieu at google.com ---
This is working as intended.  A read from uninitialized memory has undefined
behavior.  When a program runs into undefined behavior, anything can happen. 
The optimizer detects that the condition is only evaluated after undefined
behavior has happened.  Because of that, it removes the if-branch and executes
the else-branch unconditionally.

-- 
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/20180612/61d640f8/attachment.html>


More information about the llvm-bugs mailing list