http://llvm.org/bugs/show_bug.cgi?id=9088
Summary: Instcombine fails to clear NSW/NUW flags when updating
binops in place
Product: new-bugs
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
I noticed that InstCombiner::SimplifyAssociativeOrCommutative turns
(A * B) * C into A * (B * C) if it can simplify B * C. Rather
than creating a new instruction it modifies "A * B" in place,
replacing B with whatever "B * C" simplified to. Thus if A * B
was marked as not overflowing then the modified instruction will
also be marked as not overflowing since the flags are not touched.
But as far as I can see that is wrong: the modified instruction
could overflow even if the original one could not.
This update-in-place scheme seems to be used in a bunch of places
in instcombine, so it looks like instcombine needs to be audited
and nsw/nuw flags cleared in situations like this.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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