# HG changeset patch # User kono # Date 1160532886 -32400 # Node ID 62c4da6375489262d1a21af463342f75632ab459 # Parent fbd815a59787f4013c3f66203a9377eb925db9cd Intel Mac check-all-code done diff -r fbd815a59787 -r 62c4da637548 mc-code-ia32.c --- 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";