From e26b74152398adf6c932ddfbecec13b7131b3dae Mon Sep 17 00:00:00 2001 From: Ken Thompson Date: Mon, 7 Feb 2011 17:21:04 -0800 Subject: [PATCH] peep: fix optimization bug R=r CC=golang-dev https://golang.org/cl/4105058 --- src/cmd/5g/peep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmd/5g/peep.c b/src/cmd/5g/peep.c index 783934f9d42..3b31870981d 100644 --- a/src/cmd/5g/peep.c +++ b/src/cmd/5g/peep.c @@ -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;