1
0
mirror of https://github.com/golang/go synced 2024-11-19 12:34:47 -07:00

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
This commit is contained in:
Austin Clements 2014-11-05 15:14:47 -05:00
parent c6e53fea10
commit bb4a358af3

View File

@ -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);