[llvm-bugs] [Bug 32949] New: [InstSimplify] Miscompilation of sdiv + udiv
via llvm-bugs
llvm-bugs at lists.llvm.org
Sat May 6 11:47:32 PDT 2017
https://bugs.llvm.org/show_bug.cgi?id=32949
Bug ID: 32949
Summary: [InstSimplify] Miscompilation of sdiv + udiv
Product: libraries
Version: trunk
Hardware: All
OS: All
Status: NEW
Keywords: miscompilation
Severity: normal
Priority: P
Component: Scalar Optimizations
Assignee: unassignedbugs at nondot.org
Reporter: nunoplopes at sapo.pt
CC: david.majnemer at gmail.com, llvm-bugs at lists.llvm.org,
regehr at cs.utah.edu, spatel+llvm at rotateright.com
InstSimplify miscompiles the following:
define i2 @func68396950(i2) {
%2 = sdiv exact i2 1, %0
%3 = sdiv exact i2 -1, %0
%4 = udiv i2 %2, %3
ret i2 %4
}
$ opt -S a.ll -instsimplify
define i2 @func68396950(i2) {
ret i2 0
}
Alive says:
ERROR: Mismatch in values of i2 ret_
Example:
%0 i2 = 0x3 (3, -1)
%2 i2 = 0x3 (3, -1)
%3 i2 = 0x1 (1)
%4 i2 = 0x3 (3, -1)
Source value: 0x3 (3, -1)
Target value: 0x0 (0)
http://rise4fun.com/Alive/5mO
--
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/20170506/be1933d9/attachment-0001.html>
More information about the llvm-bugs
mailing list