summaryrefslogtreecommitdiff
path: root/src/cmd/5g
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2014-11-05 15:14:47 -0500
committerAustin Clements <austin@google.com>2014-11-05 15:14:47 -0500
commit9d825d7306e349e99c31acfb02ae06925040fa5b (patch)
treebb6b9bfa2cd76151f560336bc91874744dd64aa0 /src/cmd/5g
parenta2b2ebdbfcf213a434642cdc27ed0bab244207ac (diff)
downloadgo-9d825d7306e349e99c31acfb02ae06925040fa5b.tar.gz
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://codereview.appspot.com/169110043
Diffstat (limited to 'src/cmd/5g')
-rw-r--r--src/cmd/5g/reg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/5g/reg.c b/src/cmd/5g/reg.c
index 8e49a2d9c..27d9d3e8b 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);