aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/copyelim.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2016-03-08 20:09:48 -0800
committerKeith Randall <khr@golang.org>2016-03-11 00:56:04 +0000
commit31d13f479a19ca6e07ad60c441298c6eca04eeb2 (patch)
tree11a9484b53aab5f4667c4e56d865a35e1f73eab1 /src/cmd/compile/internal/ssa/copyelim.go
parentfb9aafac97649a11301b78ee9e2139804c52b528 (diff)
downloadgo-31d13f479a19ca6e07ad60c441298c6eca04eeb2.tar.gz
go-31d13f479a19ca6e07ad60c441298c6eca04eeb2.zip
cmd/compile: don't use PPARAMOUT names for temps
The location of VARDEFs is incorrect for PPARAMOUT variables which are also used as temporary locations. We put in VARDEFs when setting the variable at return time, but when the location is also used as a temporary the lifetime values are wrong. Fix copyelim to update the names map properly. This is a real name bug fix which, as a result, allows me to write a reasonable test to trigger the PPARAMOUT bug. This is kind of a band-aid fix for #14591. A more pricipled fix (which allows values to be stored in the return variable earlier than the return point) will be harder. Fixes #14591 Change-Id: I7df8ae103a982d1f218ed704c080d7b83cdcfdd9 Reviewed-on: https://go-review.googlesource.com/20457 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/copyelim.go')
-rw-r--r--src/cmd/compile/internal/ssa/copyelim.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssa/copyelim.go b/src/cmd/compile/internal/ssa/copyelim.go
index cfeff21e84..5488134122 100644
--- a/src/cmd/compile/internal/ssa/copyelim.go
+++ b/src/cmd/compile/internal/ssa/copyelim.go
@@ -28,7 +28,7 @@ func copyelim(f *Func) {
x = x.Args[0]
}
if x != v {
- values[i] = v
+ values[i] = x
}
}
}