]> Cypherpunks repositories - gostls13.git/commitdiff
5g: don't generate reg variables for direct-called functions
authorAustin Clements <austin@google.com>
Wed, 5 Nov 2014 20:14:47 +0000 (15:14 -0500)
committerAustin Clements <austin@google.com>
Wed, 5 Nov 2014 20:14:47 +0000 (15:14 -0500)
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

src/cmd/5g/reg.c

index 8e49a2d9c83b795da1b97f2cfb70032bde1f016e..27d9d3e8be227d72169f000399e3d3630b1b3479 100644 (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);