diff mc-code-powerpc.c @ 554:dc677ac7a744

emit_pop_free kills creg after emit_copy.
author kono
date Thu, 05 Jan 2006 23:37:19 +0900
parents 293f827ccfb2
children ac181d7f9c82
line wrap: on
line diff
--- a/mc-code-powerpc.c	Thu Jan 05 21:29:55 2006 +0900
+++ b/mc-code-powerpc.c	Thu Jan 05 23:37:19 2006 +0900
@@ -749,7 +749,7 @@
 void
 emit_pop_free(int xreg)
 {
-    if (xreg>=0)
+    if (xreg>=0 && xreg!=creg)
 	free_register(xreg);
 }
 
@@ -1546,7 +1546,6 @@
     char *frn;
     char *trn;
     char *drn;
-    int fix = 0;
     char *memmove = "memmove";
     int dreg = get_register(); if (!dreg) error(-1);
 
@@ -1600,20 +1599,19 @@
         /* overrap must be allowed */
 	printf("\tbl L_%s$stub\n",memmove);
 	extern_define(memmove,0,FUNCTION,1);
-        fix=0;
 	set_ireg(RET_REGISTER,0);
-	if (creg!=to) {
-	    free_register(to); to = creg;
-	}
+	//if (creg!=to) {
+	//    free_register(to); to = creg;
+	//}
 	break;
     }
     if (value) {
     /* creg must point top of the destination data */
     /* this code is necessary for the value of assignment or function call */
     /* otherwise we don't need this */
-	if (fix) printf("\taddi %s,%s,%d\n",trn,trn,fix);
 	if(creg!=to) {
-	    free_register(creg); creg=to; ireg=to;
+	    free_register(to);
+	    // set_ireg(to,1);
 	}
     }
     free_register(dreg);