Skip to content

Commit 965e9ba

Browse files
cuonglmprattmic
authored andcommitted
[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 <[email protected]> Reviewed-by: Keith Randall <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> Auto-Submit: Cuong Manh Le <[email protected]> Reviewed-on: https://go-review.googlesource.com/c/go/+/467035 Run-TryBot: Matthew Dempsky <[email protected]>
1 parent 85ded85 commit 965e9ba

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/cmd/compile/internal/base/flag.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func ParseFlags() {
167167

168168
Debug.ConcurrentOk = true
169169
Debug.InlFuncsWithClosures = 1
170-
Debug.InlStaticInit = 1
170+
Debug.InlStaticInit = 0
171171
if buildcfg.Experiment.Unified {
172172
Debug.Unified = 1
173173
}

test/fixedbugs/issue56778.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compiledir
1+
// compiledir -d=inlstaticinit=1
22

33
// Copyright 2022 The Go Authors. All rights reserved.
44
// Use of this source code is governed by a BSD-style

test/inline.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// errorcheckwithauto -0 -m -d=inlfuncswithclosures=1
1+
// errorcheckwithauto -0 -m -d=inlfuncswithclosures=1 -d=inlstaticinit=1
22

33
// Copyright 2015 The Go Authors. All rights reserved.
44
// Use of this source code is governed by a BSD-style

test/noinit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run
1+
// run -gcflags=-d=inlstaticinit=1
22
//go:build !gcflags_noopt
33

44
// Copyright 2010 The Go Authors. All rights reserved.

0 commit comments

Comments
 (0)