From: Austin Clements Date: Wed, 5 Nov 2014 20:14:47 +0000 (-0500) Subject: 5g: don't generate reg variables for direct-called functions X-Git-Tag: go1.4rc1~48 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=bb4a358af3469a1dee0cb5bcae245865233aa9ea;p=gostls13.git 5g: don't generate reg variables for direct-called functions The test intended to skip direct calls when creating registerization variables was testing p->to.type instead of p->to.name, so it always failed, causing regopt to create unnecessary variables for these names. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/169110043 --- diff --git a/src/cmd/5g/reg.c b/src/cmd/5g/reg.c index 8e49a2d9c8..27d9d3e8be 100644 --- a/src/cmd/5g/reg.c +++ b/src/cmd/5g/reg.c @@ -199,7 +199,7 @@ regopt(Prog *firstp) proginfo(&info, p); // Avoid making variables for direct-called functions. - if(p->as == ABL && p->to.type == D_EXTERN) + if(p->as == ABL && p->to.name == D_EXTERN) continue; bit = mkvar(r, &p->from);