commit | af6be11a601711f9c41a0f51acd3efcee5e00222 | [log] [tgz] |
---|---|---|
author | David Majnemer <david.majnemer@gmail.com> | Mon Oct 13 22:37:51 2014 +0000 |
committer | David Majnemer <david.majnemer@gmail.com> | Mon Oct 13 22:37:51 2014 +0000 |
tree | 60fd27a96bccc1727aa3b596ef7de33e8c55f4d1 | |
parent | 3a143ce2e79a7a7a12981f2d13ea771ff31ff888 [diff] |
InstCombine: Fix miscompile in X % -Y -> X % Y transform We assumed that negation operations of the form (0 - %Z) resulted in a negative number. This isn't true if %Z was originally negative. Substituting the negative number into the remainder operation may result in undefined behavior because the dividend might be INT_MIN. This fixes PR21256. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219639 91177308-0d34-0410-b5e6-96231b3b80d8