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

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
                 CC|                            |[email protected]
             Status|NEW                         |RESOLVED

--- Comment #1 from [email protected] ---
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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to