diff mc-codegen.c @ 368:be56772ab12a global-offset

global offset, parallel_rassign fix, save_stack fix.
author kono
date Wed, 07 Jul 2004 23:43:19 +0900
parents 4efbb07f556b
children cd2c80d8cf8b
line wrap: on
line diff
--- a/mc-codegen.c	Wed Jul 07 20:50:07 2004 +0900
+++ b/mc-codegen.c	Wed Jul 07 23:43:19 2004 +0900
@@ -799,7 +799,7 @@
 extern void
 parallel_rassign(int assigns)
 {
-    int free,tmp,tmp_target,remains,t0,t2,src;
+    int free,tmp,remains,t0,t2,src;
     tmp = 0;
     for(;;) {
 	remains = 0;
@@ -817,24 +817,27 @@
 	    } 
 	}
 	if (remains==0) {
-	    if (tmp) {
-		code_rlvar(tmp,tmp_target);
-	    }
 	    return;
 	}
 	if (free) {  // free target
-	    if (t0!=caddr(free))
-		code_assign_register(t0,0,caddr(free));
+	    if (t0!=caddr(free)) {
+		if (caddr(free)>=0) {
+		    code_assign_register(t0,0,caddr(free));
+		} else {
+		    code_rlvar(caddr(free),t0);
+		}
+	    }
+	    caddr(free)=0;       // mark it done
 	} else {  // no free target
 	    for(free=assigns;free;free=cadr(free)) {
 		if (caddr(free)) break; // not yet done
 	    }
 	    if (!free) error(-1);
 	    tmp = new_lvar(size_of_int);
-	    tmp_target = car(free);
+	    if (tmp>0) error(-1);
 	    code_assign_lvar(tmp,caddr(free),0);
+	    caddr(free) = tmp;
 	}
-	caddr(free)=0;       // mark it done
     }
 }