]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/6g: fix stack zeroing preamble on amd64p32.
authorRémy Oudompheng <oudomphe@phare.normalesup.org>
Thu, 13 Mar 2014 07:12:38 +0000 (08:12 +0100)
committerRémy Oudompheng <oudomphe@phare.normalesup.org>
Thu, 13 Mar 2014 07:12:38 +0000 (08:12 +0100)
It was using a REP STOSQ but putting in CX the number of 32-bit
words to clear.

LGTM=dave
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/75240043

src/cmd/6g/ggen.c

index 8b0c287400391fe976d4117d8ce756e272bb972a..230c0a2ca0dd6130d5ce40900a9a3afd09b85ff4 100644 (file)
@@ -30,11 +30,11 @@ defframe(Prog *ptxt)
        // when it looks for pointers.
        p = ptxt;
        if(stkzerosize > 0) {
-               p = appendpp(p, AMOVQ, D_CONST, 0, D_AX, 0);    
-               p = appendpp(p, AMOVQ, D_CONST, stkzerosize/widthptr, D_CX, 0); 
-               p = appendpp(p, ALEAQ, D_SP+D_INDIR, frame-stkzerosize, D_DI, 0);       
+               p = appendpp(p, movptr, D_CONST, 0, D_AX, 0);   
+               p = appendpp(p, movptr, D_CONST, stkzerosize/widthptr, D_CX, 0);        
+               p = appendpp(p, leaptr, D_SP+D_INDIR, frame-stkzerosize, D_DI, 0);      
                p = appendpp(p, AREP, D_NONE, 0, D_NONE, 0);    
-               appendpp(p, ASTOSQ, D_NONE, 0, D_NONE, 0);      
+               appendpp(p, stosptr, D_NONE, 0, D_NONE, 0);     
        }
 }