From: ceriel Date: Fri, 12 Jun 1992 09:46:43 +0000 (+0000) Subject: Fix: sometimes did not reserve space for local on a mes ms_gto X-Git-Tag: release-5-5~468 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=46f084d66013c21ebdb66e1010d14b825328bdb9;p=ack.git Fix: sometimes did not reserve space for local on a mes ms_gto --- diff --git a/mach/i386/ncg/mach.c b/mach/i386/ncg/mach.c index 3388c6696..a3d874b80 100644 --- a/mach/i386/ncg/mach.c +++ b/mach/i386/ncg/mach.c @@ -78,7 +78,7 @@ prolog(nlocals) full nlocals; { break; default: #endif - fprintf(codefile, "\tsub\tesp,%ld\n",nlocals); + fprintf(codefile, "sub\tesp,%ld\n",nlocals); #ifdef NOTDEF break; } @@ -112,10 +112,12 @@ i_regsave() f_regsave() { - if (si_off == -lbytes) lbytes -= 4; - if (di_off == -lbytes) lbytes -= 4; - if (si_off == -lbytes) lbytes -= 4; - if (lbytes) fprintf(codefile, "\tsub\tesp,%ld\n",(long) lbytes); + if (si_off != di_off) { + if (si_off == -lbytes) lbytes -= 4; + if (di_off == -lbytes) lbytes -= 4; + if (si_off == -lbytes) lbytes -= 4; + } + if (lbytes) fprintf(codefile, "sub\tesp,%ld\n",(long) lbytes); if (firstreg == 1) { fputs("push edi\n", codefile); if (si_off != -1) fputs("push esi\n", codefile); diff --git a/mach/i86/ncg/mach.c b/mach/i86/ncg/mach.c index b56d5f90a..ba4144eac 100644 --- a/mach/i86/ncg/mach.c +++ b/mach/i86/ncg/mach.c @@ -103,9 +103,11 @@ i_regsave() f_regsave() { - if (di_off == -lbytes) lbytes -= 2; - if (si_off == -lbytes) lbytes -= 2; - if (di_off == -lbytes) lbytes -= 2; + if (si_off != di_off) { + if (di_off == -lbytes) lbytes -= 2; + if (si_off == -lbytes) lbytes -= 2; + if (di_off == -lbytes) lbytes -= 2; + } switch (lbytes) { case 4: fputs("\tpush\tax\n", codefile); case 2: fputs("\tpush\tax\n", codefile);