Browse Source

rega: Fix allocation of multiple temporaries to the same register

Michael Forney 5 years ago
parent
commit
9639940cb4
1 changed files with 1 additions and 0 deletions
  1. 1 0
      rega.c

+ 1 - 0
rega.c

@@ -605,6 +605,7 @@ rega(Fn *fn)
 			if (x > 0 && !bshas(m->b, x)) {
 			if (x > 0 && !bshas(m->b, x)) {
 				pmadd(TMP(x), TMP(r), tmp[t].cls);
 				pmadd(TMP(x), TMP(r), tmp[t].cls);
 				m->r[j] = x;
 				m->r[j] = x;
+				bsset(m->b, x);
 			}
 			}
 		}
 		}
 		curi = &insb[NIns];
 		curi = &insb[NIns];