Shut up some compilers that can't accurately analyze variable usage
authorReid Spencer <rspencer@reidspencer.com>
Sat, 23 Dec 2006 19:17:57 +0000 (19:17 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sat, 23 Dec 2006 19:17:57 +0000 (19:17 +0000)
correctly and emit "may be used uninitialized" warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32756 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index 3397530482f97852f781d69edc6775e2b3d93350..d0e74c1fa07e35fdd78f4df166a73e1522201321 100644 (file)
@@ -4518,8 +4518,8 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) {
     if (KnownOne | KnownZero) {
       // Compute the Min, Max and RHS values based on the known bits. For the
       // EQ and NE we use unsigned values.
-      uint64_t UMin, UMax, URHSVal;
-      int64_t SMin, SMax, SRHSVal;
+      uint64_t UMin = 0, UMax = 0, URHSVal = 0;
+      int64_t SMin = 0, SMax = 0, SRHSVal = 0;
       if (ICmpInst::isSignedPredicate(I.getPredicate())) {
         SRHSVal = CI->getSExtValue();
         ComputeSignedMinMaxValuesFromKnownBits(Ty, KnownZero, KnownOne, SMin,