summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-10-01 13:20:21 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-10-01 13:20:21 -0400
commitecaad8119f77601fec4cab61c510d697ec5bb939 (patch)
tree4f4d285ffaa84fae37de509216ba0ad78b15cc58
parent3ef269315409c698a1e0f689722136dcd974fe36 (diff)
downloadroux-ecaad8119f77601fec4cab61c510d697ec5bb939.tar.gz
fix a bug for structure arguments in regs
-rw-r--r--lisc/isel.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisc/isel.c b/lisc/isel.c
index 9767a7a..09af1d1 100644
--- a/lisc/isel.c
+++ b/lisc/isel.c
@@ -605,9 +605,10 @@ selpar(Fn *fn, Ins *i0, Ins *i1)
 	for (i=i0, a=ac; i<i1; i++, a++) {
 		if (i->op != OParc || a->inmem)
 			continue;
-		for (al=0; a->align >> (al+2); al++) /* careful here, this is because base alloc is aligned at 4 */
+		assert(NAlign == 3);
+		for (al=0; a->align >> (al+2); al++)
 			;
-		r1 = newtmp(fn);
+		r1 = i->to;
 		r = TMP(a->rty[0]);
 		r2 = newcon(a->size, fn);
 		*curi++ = (Ins){OAlloc+al, 1, r1, {r2}};