]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/5g: fix bit mask for div/mod routines clobbering R12
authorIan Lance Taylor <iant@golang.org>
Mon, 10 Nov 2014 02:55:36 +0000 (18:55 -0800)
committerIan Lance Taylor <iant@golang.org>
Mon, 10 Nov 2014 02:55:36 +0000 (18:55 -0800)
This patch is based only on reading the code.  I have not
tried to construct a test case.

Fixes #9077.

LGTM=minux
R=minux
CC=golang-codereviews
https://golang.org/cl/172110043

src/cmd/5g/reg.c

index 27d9d3e8be227d72169f000399e3d3630b1b3479..b78c268df5bfdb6d78c6e7b5dd871886c47dea42 100644 (file)
@@ -230,7 +230,7 @@ regopt(Prog *firstp)
 
                /* the mod/div runtime routines smash R12 */
                if(p->as == ADIV || p->as == ADIVU || p->as == AMOD || p->as == AMODU)
-                       r->set.b[z] |= RtoB(12);
+                       r->set.b[0] |= RtoB(12);
        }
        if(firstr == R)
                return;