nv50/ir/ra: Fix traversal before the beginning of the active list in buildRIG.
authorFrancisco Jerez <currojerez@riseup.net>
Mon, 30 Apr 2012 13:19:40 +0000 (15:19 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 12 Mar 2013 11:55:33 +0000 (12:55 +0100)
src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp

index 149e4e1a38e88e52bafdc9bdbd9e8cabcdea8f2f..b74faec1d4f70799caf2295dd4fc715790fce133 100644 (file)
@@ -1061,16 +1061,15 @@ GCRA::buildRIG(ArrayList& insns)
       RIG_Node *cur = values.front();
 
       for (std::list<RIG_Node *>::iterator it = active.begin();
-           it != active.end();
-           ++it) {
+           it != active.end();) {
          RIG_Node *node = *it;
 
          if (node->livei.end() <= cur->livei.begin()) {
             it = active.erase(it);
-            --it;
-         } else
-         if (node->f == cur->f && node->livei.overlaps(cur->livei)) {
-            cur->addInterference(node);
+         } else {
+            if (node->f == cur->f && node->livei.overlaps(cur->livei))
+               cur->addInterference(node);
+            ++it;
          }
       }
       values.pop_front();