summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2014-06-04 07:45:54 +0000
committerNick Lewycky <nicholas@mxc.ca>2014-06-04 07:45:54 +0000
commit0a9a866ce1b0b59af324d2001689ca89b6957e98 (patch)
tree79c5471694393ba2f24ad69cf875ce70112d6258 /llvm/lib
parent8d2ee37f3175a03759aa2170dc1cdeaa38e68cf3 (diff)
downloadbcm5719-llvm-0a9a866ce1b0b59af324d2001689ca89b6957e98.tar.gz
bcm5719-llvm-0a9a866ce1b0b59af324d2001689ca89b6957e98.zip
Fix a use of uninitialized value. OldCC is set when IsCmpZero || IsSwapped and read when ShouldUpdateCC || IsSwapped, and ShouldUpdateCC is independent. Fixes PR19932, but no test since I wasn't able to get any symptoms to appear, not even with valgrind and the testcase from the PR. It's clear what happened from inspection of the code.
llvm-svn: 210168
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86InstrInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp
index 6993577d19c..a0ee1ee57be 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.cpp
+++ b/llvm/lib/Target/X86/X86InstrInfo.cpp
@@ -3741,7 +3741,7 @@ optimizeCompareInstr(MachineInstr *CmpInstr, unsigned SrcReg, unsigned SrcReg2,
continue;
// EFLAGS is used by this instruction.
- X86::CondCode OldCC;
+ X86::CondCode OldCC = X86::COND_INVALID;
bool OpcIsSET = false;
if (IsCmpZero || IsSwapped) {
// We decode the condition code from opcode.
OpenPOWER on IntegriCloud