https://llvm.org/bugs/show_bug.cgi?id=24090
David Majnemer <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |[email protected] Resolution|--- |INVALID --- Comment #1 from David Majnemer <[email protected]> --- Your code relies on undefined behavior. Because of this, LLVM's optimizations cannot ensure your program will have the same result as an -O0 build. angle is 315. angle / 45 is 7. ANG45 * 7 == 536870912 * 7 == -536870912. Multiplying two positive signed integers cannot result in a negative number without violating C or C++'s rules on undefined behavior: signed overflow is undefined. The operations you perform with 'an' assume that signed overflow does not occur, because doing so is undefined, and thus the incongruent behavior between -O0 and -O3. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ LLVMbugs mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs
