1
0
mirror of https://github.com/golang/go synced 2024-10-03 07:21:21 -06:00

8g: fix 386 floating point stack bug

Also fixes issue 310 comment 5 error.
Fixes #310.

R=rsc
https://golang.org/cl/163042
This commit is contained in:
Charles L. Dorian 2009-12-01 15:53:50 -08:00 committed by Russ Cox
parent a0f742d343
commit e1c347ca59
3 changed files with 10 additions and 5 deletions

View File

@ -254,7 +254,9 @@ regopt(Prog *p)
*/
case AFMOVDP:
case AFMOVFP:
case AFMOVLP:
case AFMOVVP:
case AFMOVWP:
case ACALL:
for(z=0; z<BITS; z++)
addrs.b[z] |= bit.b[z];

10
src/cmd/8g/gsubr.c Executable file → Normal file
View File

@ -1289,10 +1289,12 @@ gmove(Node *f, Node *t)
if(t->op == OREGISTER)
goto hardmem;
nodreg(&r1, types[ft], D_F0);
if(ft == TFLOAT32 && f->op != OREGISTER)
gins(AFMOVF, f, &r1);
else
gins(AFMOVD, f, &r1);
if(f->op != OREGISTER) {
if(ft == TFLOAT32)
gins(AFMOVF, f, &r1);
else
gins(AFMOVD, f, &r1);
}
// set round to zero mode during conversion
tempalloc(&t1, types[TUINT16]);

View File

@ -306,8 +306,9 @@ regopt(Prog *firstp)
*/
case AFMOVDP:
case AFMOVFP:
case AFMOVVP:
case AFMOVLP:
case AFMOVVP:
case AFMOVWP:
case ACALL:
for(z=0; z<BITS; z++)
addrs.b[z] |= bit.b[z];