From: Alkis Evlogimenos Date: Wed, 14 Jan 2004 00:20:09 +0000 (+0000) Subject: Fix bug in LiveIntervals::Interval::overlaps and X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9739736b94b1116be2043e05567aa8899593ab29;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10835 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index acc32117c00..fb577228e82 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.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 {