aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2015-06-16 18:28:01 -0400
committerDavid Chase <drchase@google.com>2015-06-17 02:36:45 +0000
commit5be61b18d457544647e1fd7b6e2282a4a79fe0d0 (patch)
tree6dbc6e4a189a1365721e43e3c413555b3fa10b4f /src
parent6428a8b437a36f07b5f0d1b6f0d06e3ee6fc57c1 (diff)
downloadgo-5be61b18d457544647e1fd7b6e2282a4a79fe0d0.tar.xz
cmd/compile: run escape analysis after method wrapper generation
Also modified test/run.go to ignore messages prefixed <autogenerated> because those cannot be described with "// ERROR ...", and backed out patch from issue #9537 because it is no longer necessary. The reasons described in the 9537 discussion for why escape analysis cannot run late no longer hold, happily. Fixes #11053. Change-Id: Icb14eccdf2e8cde3d0f8fb8a216b765400a96385 Reviewed-on: https://go-review.googlesource.com/11088 Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: David Chase <drchase@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/gc/go.go2
-rw-r--r--src/cmd/compile/internal/gc/inl.go10
-rw-r--r--src/cmd/compile/internal/gc/subr.go9
3 files changed, 5 insertions, 16 deletions
diff --git a/src/cmd/compile/internal/gc/go.go b/src/cmd/compile/internal/gc/go.go
index 024810e0b8..7951e72bb6 100644
--- a/src/cmd/compile/internal/gc/go.go
+++ b/src/cmd/compile/internal/gc/go.go
@@ -644,8 +644,6 @@ var compiling_runtime int
var compiling_wrappers int
-var inl_nonlocal int
-
var use_writebarrier int
var pure_go int
diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go
index ea11740c9a..d29ee59c54 100644
--- a/src/cmd/compile/internal/gc/inl.go
+++ b/src/cmd/compile/internal/gc/inl.go
@@ -831,12 +831,10 @@ func inlvar(var_ *Node) *Node {
n.Name.Curfn = Curfn // the calling function, not the called one
n.Addrtaken = var_.Addrtaken
- // Esc pass wont run if we're inlining into a iface wrapper.
- // Luckily, we can steal the results from the target func.
- // If inlining a function defined in another package after
- // escape analysis is done, treat all local vars as escaping.
- // See issue 9537.
- if var_.Esc == EscHeap || (inl_nonlocal != 0 && var_.Op == ONAME) {
+ // This may no longer be necessary now that we run escape analysis
+ // after wrapper generation, but for 1.5 this is conservatively left
+ // unchanged. See bugs 11053 and 9537.
+ if var_.Esc == EscHeap {
addrescapes(n)
}
diff --git a/src/cmd/compile/internal/gc/subr.go b/src/cmd/compile/internal/gc/subr.go
index a759f39b57..beb3c3c386 100644
--- a/src/cmd/compile/internal/gc/subr.go
+++ b/src/cmd/compile/internal/gc/subr.go
@@ -2494,15 +2494,8 @@ func genwrapper(rcvr *Type, method *Type, newnam *Sym, iface int) {
typecheck(&fn, Etop)
typechecklist(fn.Nbody, Etop)
- // Set inl_nonlocal to whether we are calling a method on a
- // type defined in a different package. Checked in inlvar.
- if !methodrcvr.Local {
- inl_nonlocal = 1
- }
-
inlcalls(fn)
-
- inl_nonlocal = 0
+ escAnalyze(list1(fn), false)
Curfn = nil
funccompile(fn)