[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Jun 16 19:06:06 PDT 2005



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.353 -> 1.354
---
Log message:

Don't crash when dealing with INTMIN.  This fixes PR585: http://llvm.cs.uiuc.edu/PR585  and
Transforms/InstCombine/2005-06-16-RangeCrash.ll


---
Diffs of the changes:  (+2 -0)

 InstructionCombining.cpp |    2 ++
 1 files changed, 2 insertions(+)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.353 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.354
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.353	Thu Jun 16 20:29:28 2005
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Thu Jun 16 21:05:55 2005
@@ -2699,6 +2699,8 @@
             if (CI->isNullValue()) {       // (X / neg) op 0
               LoBound = AddOne(DivRHS);
               HiBound = cast<ConstantInt>(ConstantExpr::getNeg(DivRHS));
+              if (HiBound == DivRHS)
+                LoBound = 0;  // - INTMIN = INTMIN
             } else if (isPositive(CI)) {   // (X / neg) op pos
               HiOverflow = LoOverflow = ProdOV;
               if (!LoOverflow)






More information about the llvm-commits mailing list