diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp --- a/clang/lib/CodeGen/CGBlocks.cpp +++ b/clang/lib/CodeGen/CGBlocks.cpp @@ -2697,7 +2697,7 @@ } bool HasByrefExtendedLayout = false; - Qualifiers::ObjCLifetime Lifetime; + Qualifiers::ObjCLifetime Lifetime = Qualifiers::OCL_None;; if (getContext().getByrefLifetime(Ty, Lifetime, HasByrefExtendedLayout) && HasByrefExtendedLayout) { /// void *__byref_variable_layout; @@ -2767,8 +2767,8 @@ const VarDecl &D = *emission.Variable; QualType type = D.getType(); - bool HasByrefExtendedLayout; - Qualifiers::ObjCLifetime ByrefLifetime; + bool HasByrefExtendedLayout = false; + Qualifiers::ObjCLifetime ByrefLifetime = Qualifiers::OCL_None; bool ByRefHasLifetime = getContext().getByrefLifetime(type, ByrefLifetime, HasByrefExtendedLayout); diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp --- a/llvm/lib/CodeGen/RegisterCoalescer.cpp +++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp @@ -442,7 +442,7 @@ Flipped = CrossClass = false; Register Src, Dst; - unsigned SrcSub, DstSub; + unsigned SrcSub = 0, DstSub = 0; if (!isMoveInstr(TRI, MI, Src, Dst, SrcSub, DstSub)) return false; Partial = SrcSub || DstSub; @@ -537,7 +537,7 @@ if (!MI) return false; Register Src, Dst; - unsigned SrcSub, DstSub; + unsigned SrcSub = 0, DstSub = 0; if (!isMoveInstr(TRI, MI, Src, Dst, SrcSub, DstSub)) return false; @@ -1590,7 +1590,7 @@ // CoalescerPair may have a new register class with adjusted subreg indices // at this point. Register SrcReg, DstReg; - unsigned SrcSubIdx, DstSubIdx; + unsigned SrcSubIdx = 0, DstSubIdx = 0; if(!isMoveInstr(*TRI, CopyMI, SrcReg, DstReg, SrcSubIdx, DstSubIdx)) return nullptr; @@ -1966,7 +1966,7 @@ if (!canJoinPhys(CP)) { // Before giving up coalescing, if definition of source is defined by // trivial computation, try rematerializing it. - bool IsDefCopy; + bool IsDefCopy = false; if (reMaterializeTrivialDef(CP, CopyMI, IsDefCopy)) return true; if (IsDefCopy) @@ -2005,7 +2005,7 @@ // If definition of source is defined by trivial computation, try // rematerializing it. - bool IsDefCopy; + bool IsDefCopy = false; if (reMaterializeTrivialDef(CP, CopyMI, IsDefCopy)) return true; @@ -3798,7 +3798,7 @@ if (!UseTerminalRule) return false; Register SrcReg, DstReg; - unsigned SrcSubReg, DstSubReg; + unsigned SrcSubReg = 0, DstSubReg = 0; if (!isMoveInstr(*TRI, &Copy, SrcReg, DstReg, SrcSubReg, DstSubReg)) return false; // Check if the destination of this copy has any other affinity. @@ -3823,7 +3823,7 @@ if (&MI == &Copy || !MI.isCopyLike() || MI.getParent() != OrigBB) continue; Register OtherSrcReg, OtherReg; - unsigned OtherSrcSubReg, OtherSubReg; + unsigned OtherSrcSubReg = 0, OtherSubReg = 0; if (!isMoveInstr(*TRI, &Copy, OtherSrcReg, OtherReg, OtherSrcSubReg, OtherSubReg)) return false; diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -13830,7 +13830,7 @@ assert(V2.getSimpleValueType() == MVT::v4f32 && "Bad operand type!"); // Attempt to match the insertps pattern. - unsigned InsertPSMask; + unsigned InsertPSMask = 0; if (!matchShuffleAsInsertPS(V1, V2, InsertPSMask, Zeroable, Mask, DAG)) return SDValue();