]> Cypherpunks repositories - gostls13.git/commitdiff
peep: fix optimization bug
authorKen Thompson <ken@golang.org>
Tue, 8 Feb 2011 01:21:04 +0000 (17:21 -0800)
committerKen Thompson <ken@golang.org>
Tue, 8 Feb 2011 01:21:04 +0000 (17:21 -0800)
R=r
CC=golang-dev
https://golang.org/cl/4105058

src/cmd/5g/peep.c

index 783934f9d42e1673dac73cd02bf237854cc9d2c3..3b31870981df9afdccd215fd165b42a3573c2e27 100644 (file)
@@ -366,7 +366,8 @@ subprop(Reg *r0)
                case ADIVD:
                case ADIVF:
                        if(p->to.type == v1->type)
-                       if(p->to.reg == v1->reg) {
+                       if(p->to.reg == v1->reg)
+                       if(p->scond == 0) {
                                if(p->reg == NREG)
                                        p->reg = p->to.reg;
                                goto gotit;
@@ -378,6 +379,7 @@ subprop(Reg *r0)
                case AMOVW:
                        if(p->to.type == v1->type)
                        if(p->to.reg == v1->reg)
+                       if(p->scond == 0)
                                goto gotit;
                        break;