Skip to content

Commit

Permalink
[release-branch.go1.20] cmd/compile: disable inline static init optim…
Browse files Browse the repository at this point in the history
…ization

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>
  • Loading branch information
cuonglm authored and prattmic committed Feb 15, 2023
1 parent 85ded85 commit 965e9ba
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/base/flag.go
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down
2 changes: 1 addition & 1 deletion 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.
Expand Down

0 comments on commit 965e9ba

Please sign in to comment.