aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
diff options
context:
space:
mode:
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>2016-02-22 18:04:00 +0000
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>2016-02-22 18:04:00 +0000
commita8ef3c9b868946541cf299d9f510ff09058a3a6a (patch)
tree16783639266afc8c8c297a279856c58931c5b240 /llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
parenteb6673cfed481ec3200331998f042a5beb5cfae9 (diff)
downloadllvm-a8ef3c9b868946541cf299d9f510ff09058a3a6a.zip
llvm-a8ef3c9b868946541cf299d9f510ff09058a3a6a.tar.gz
llvm-a8ef3c9b868946541cf299d9f510ff09058a3a6a.tar.bz2
Fix for PR26690 take 2
This is what was meant to be in the initial commit to fix this bug. The parens were missing. This commit also adds a test case for the bug and has undergone full testing on PPC and X86. llvm-svn: 261546
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCFrameLowering.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCFrameLowering.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
index 92031d3..3fd509a 100644
--- a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
@@ -653,7 +653,7 @@ PPCFrameLowering::findScratchRegister(MachineBasicBlock *MBB,
// Now that we've done our best to provide both registers, double check
// whether we were unable to provide enough.
- if (BV.empty() || (BV.count() < 2 && TwoUniqueRegsRequired))
+ if (BV.count() < (TwoUniqueRegsRequired ? 2 : 1))
return false;
return true;