summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-07-06 16:03:21 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-07-06 16:03:21 +0000
commit3be9c5fbe7eb5acd1c03e816a7550ba2ee91b3bb (patch)
tree89159124275de9d1972aea55b0eadb6b16411e83 /llvm/lib
parente9b763a83f9f09a298e7f59a2802512cd8c17cd5 (diff)
downloadbcm5719-llvm-3be9c5fbe7eb5acd1c03e816a7550ba2ee91b3bb.tar.gz
bcm5719-llvm-3be9c5fbe7eb5acd1c03e816a7550ba2ee91b3bb.zip
Do not crash when joining two intervals of registers of different
classes: just ignore that move. Thanks to Vladimir Prus who found the bug! llvm-svn: 14644
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/LiveIntervals.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervals.cpp b/llvm/lib/CodeGen/LiveIntervals.cpp
index 9c108056445..2347c6b567a 100644
--- a/llvm/lib/CodeGen/LiveIntervals.cpp
+++ b/llvm/lib/CodeGen/LiveIntervals.cpp
@@ -502,7 +502,9 @@ void LiveIntervals::joinIntervals()
const TargetRegisterClass *rcA, *rcB;
rcA = mf_->getSSARegMap()->getRegClass(intA->reg);
rcB = mf_->getSSARegMap()->getRegClass(intB->reg);
- assert(rcA == rcB && "registers must be of the same class");
+ // if they are not of the same register class we continue
+ if (rcA != rcB)
+ continue;
// if their intervals do not overlap we join them
if (!intB->overlaps(*intA)) {
@@ -524,6 +526,13 @@ void LiveIntervals::joinIntervals()
MRegisterInfo::isVirtualRegister(intB->reg) &&
"A must be physical and B must be virtual");
+ const TargetRegisterClass *rcA, *rcB;
+ rcA = mri_->getRegClass(intA->reg);
+ rcB = mf_->getSSARegMap()->getRegClass(intB->reg);
+ // if they are not of the same register class we continue
+ if (rcA != rcB)
+ continue;
+
if (!intA->overlaps(*intB) &&
!overlapsAliases(*intA, *intB)) {
intA->join(*intB);
OpenPOWER on IntegriCloud