summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervals.cpp
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-01-14 00:20:09 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-01-14 00:20:09 +0000
commit2615c98042e45e566254bb102c898aaf1455d30f (patch)
tree9ec79cb8e14d8de945fb4d2782f3f5de90891b8b /llvm/lib/CodeGen/LiveIntervals.cpp
parenta0865cec3f9bc808fb74a4bbd9ce4c409f44a632 (diff)
downloadbcm5719-llvm-2615c98042e45e566254bb102c898aaf1455d30f.tar.gz
bcm5719-llvm-2615c98042e45e566254bb102c898aaf1455d30f.zip
Fix bug in LiveIntervals::Interval::overlaps and
LiveIntervals::Interval::liveAt. Both were considering the live ranges closed in the end, when they are actually open. llvm-svn: 10835
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervals.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervals.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervals.cpp b/llvm/lib/CodeGen/LiveIntervals.cpp
index acc32117c00..fb577228e82 100644
--- a/llvm/lib/CodeGen/LiveIntervals.cpp
+++ b/llvm/lib/CodeGen/LiveIntervals.cpp
@@ -366,7 +366,7 @@ void LiveIntervals::Interval::mergeRangesBackward(Ranges::iterator it)
bool LiveIntervals::Interval::liveAt(unsigned index) const
{
Ranges::const_iterator r = ranges.begin();
- while (r != ranges.end() && index < r->second) {
+ while (r != ranges.end() && index < (r->second - 1)) {
if (index >= r->first)
return true;
++r;
@@ -381,7 +381,7 @@ bool LiveIntervals::Interval::overlaps(const Interval& other) const
while (i != ranges.end() && j != other.ranges.end()) {
if (i->first < j->first) {
- if (i->second > j->first) {
+ if ((i->second - 1) > j->first) {
return true;
}
else {
@@ -389,7 +389,7 @@ bool LiveIntervals::Interval::overlaps(const Interval& other) const
}
}
else if (j->first < i->first) {
- if (j->second > i->first) {
+ if ((j->second - 1) > i->first) {
return true;
}
else {
OpenPOWER on IntegriCloud