summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/passes/CoalesceLocals.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/passes/CoalesceLocals.cpp b/src/passes/CoalesceLocals.cpp
index edcc9d1db..3805d7280 100644
--- a/src/passes/CoalesceLocals.cpp
+++ b/src/passes/CoalesceLocals.cpp
@@ -314,9 +314,10 @@ bool CoalesceLocals::mergeStartsAndCheckChange(std::vector<BasicBlock*>& blocks,
// this is not a new conflict.
if (ret == old) return false;
// add conflicts
- for (auto i : ret) {
- for (auto j : ret) {
- interfere(i, j);
+ size_t size = ret.size();
+ for (size_t i = 0; i < size; i++) {
+ for (size_t j = i + 1; j < size; j++) {
+ interfere(ret[i], ret[j]);
}
}
return true;