aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2023-02-10 02:13:05 +0700
committerMichael Pratt <mpratt@google.com>2023-02-15 21:45:58 +0000
commit965e9ba0fb6ed8b511860beaefa7a3ac97a81c36 (patch)
tree9a11c54b35df6af699087495dc2091a1383e7445
parent85ded85b78e881d826ed5a2e0cc1dcff8af71142 (diff)
downloadgo-965e9ba0fb6ed8b511860beaefa7a3ac97a81c36.tar.gz
go-965e9ba0fb6ed8b511860beaefa7a3ac97a81c36.zip
[release-branch.go1.20] cmd/compile: disable inline static init optimization
There are a plenty of regression in 1.20 with this optimization. This CL disable inline static init, so it's safer to backport to 1.20 branch. The optimization will be enabled again during 1.21 cycle. Fixes #58444 Change-Id: If5916008597b46146b4dc7108c6b389d53f35e95 Reviewed-on: https://go-review.googlesource.com/c/go/+/467015 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/467035 Run-TryBot: Matthew Dempsky <mdempsky@google.com>
-rw-r--r--src/cmd/compile/internal/base/flag.go2
-rw-r--r--test/fixedbugs/issue56778.go2
-rw-r--r--test/inline.go2
-rw-r--r--test/noinit.go2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/base/flag.go b/src/cmd/compile/internal/base/flag.go
index 25f8458e5c..be555c3d06 100644
--- a/src/cmd/compile/internal/base/flag.go
+++ b/src/cmd/compile/internal/base/flag.go
@@ -167,7 +167,7 @@ func ParseFlags() {
Debug.ConcurrentOk = true
Debug.InlFuncsWithClosures = 1
- Debug.InlStaticInit = 1
+ Debug.InlStaticInit = 0
if buildcfg.Experiment.Unified {
Debug.Unified = 1
}
diff --git a/test/fixedbugs/issue56778.go b/test/fixedbugs/issue56778.go
index 8bb5c3e213..3c27501fd2 100644
--- a/test/fixedbugs/issue56778.go
+++ b/test/fixedbugs/issue56778.go
@@ -1,4 +1,4 @@
-// compiledir
+// compiledir -d=inlstaticinit=1
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
diff --git a/test/inline.go b/test/inline.go
index cf2cd8cd60..1aa8fccbbd 100644
--- a/test/inline.go
+++ b/test/inline.go
@@ -1,4 +1,4 @@
-// errorcheckwithauto -0 -m -d=inlfuncswithclosures=1
+// errorcheckwithauto -0 -m -d=inlfuncswithclosures=1 -d=inlstaticinit=1
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
diff --git a/test/noinit.go b/test/noinit.go
index ed8e572e51..505467cf8f 100644
--- a/test/noinit.go
+++ b/test/noinit.go
@@ -1,4 +1,4 @@
-// run
+// run -gcflags=-d=inlstaticinit=1
//go:build !gcflags_noopt
// Copyright 2010 The Go Authors. All rights reserved.