changeset 634:62c4da637548

Intel Mac check-all-code done
author kono
date Wed, 11 Oct 2006 11:14:46 +0900
parents fbd815a59787
children e4fffa4bf9cf
files mc-code-ia32.c
diffstat 1 files changed, 17 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mc-code-ia32.c	Wed Oct 11 10:07:00 2006 +0900
+++ b/mc-code-ia32.c	Wed Oct 11 11:14:46 2006 +0900
@@ -1496,7 +1496,7 @@
     /* downward direction copy */
     emit_copy(creg,REG_ESP,length,0,0,1);
     /* we have value in creg, it may be changed */
-    stack_depth += length*SIZE_OF_INT;
+    stack_depth += length;
     return length/SIZE_OF_INT;
 }
 
@@ -1533,9 +1533,11 @@
 	    nargs += SIZE_OF_FLOAT/SIZE_OF_INT;
 	    continue;
 	} else if (car(t)==STRUCT||car(t)==UNION) {
+	    // struct must align 16 (but how?)
 	    length = size(t);
-	    length += SIZE_OF_INT - (length%SIZE_OF_INT);
-	    nargs += length/SIZE_OF_INT ;
+	    if (length%SIZE_OF_INT)
+		length += SIZE_OF_INT - (length%SIZE_OF_INT);
+	    nargs += length/SIZE_OF_INT;
 	    continue;
 	} else {
 	    error(TYERR);
@@ -2916,6 +2918,10 @@
     case DCMP: 
 	printf("\tfucompp\n");
 	printf("\tfnstsw\t%%ax\n");
+#ifdef __APPLE__
+	if (regs[REG_EAX]==PTRC_REG)
+	    clear_ptr_cache_reg(REG_EAX);
+#endif
 	break;
     }
 }
@@ -3054,6 +3060,10 @@
 {
     if (e2!=USE_CREG)
 	error(-1);
+#ifdef __APPLE__
+	if (regs[REG_EAX]==PTRC_REG)
+	    clear_ptr_cache_reg(REG_EAX);
+#endif
     printf("\tfldz\n"); 
     printf("\tfucompp\n");
     printf("\tfnstsw\t%%ax\n");
@@ -3868,6 +3878,10 @@
 #endif
 	return;
     }
+#ifdef __APPLE__
+	if (regs[REG_EAX]==PTRC_REG)
+	    clear_ptr_cache_reg(REG_EAX);
+#endif
     use_register(creg,REG_EAX,1);
     crn = "%eax";