aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2021-04-22 11:36:29 -0400
committerCherry Zhang <cherryyz@google.com>2021-04-22 16:38:37 +0000
commite8666abd9884f6743f78229ed210bf12a35e7368 (patch)
tree1c6cfff8f5e611ebf530c280e7be51ebe8085091 /test
parentd3853fb4e6ee2b9f873ab2e41adc0e62a82e73e4 (diff)
downloadgo-e8666abd9884f6743f78229ed210bf12a35e7368.tar.gz
go-e8666abd9884f6743f78229ed210bf12a35e7368.zip
cmd/compile: keep call's args in elim dead auto pass
If the address of an auto is used in a Call, we need to keep it, as we keep the Call itself. Fixes #45693. Change-Id: Ie548d6dffc95bf916868a8885d4ab4cf9e86355a Reviewed-on: https://go-review.googlesource.com/c/go/+/312670 Trust: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/issue45693.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/fixedbugs/issue45693.go b/test/fixedbugs/issue45693.go
new file mode 100644
index 0000000000..20a0cec8ff
--- /dev/null
+++ b/test/fixedbugs/issue45693.go
@@ -0,0 +1,16 @@
+// compile
+
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 45693: ICE with register args.
+
+package p
+
+func f() {
+ var s string
+ s = s + "" + s + "" + s + ""
+ for {
+ }
+}