From b7736cbceb46d00fb1c8435e5c512635896985b6 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Fri, 10 Feb 2023 02:13:05 +0700 Subject: 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. Updates #58293 Updates #58339 For #58293 Change-Id: If5916008597b46146b4dc7108c6b389d53f35e95 Reviewed-on: https://go-review.googlesource.com/c/go/+/467015 Reviewed-by: Keith Randall Reviewed-by: Keith Randall Run-TryBot: Cuong Manh Le TryBot-Result: Gopher Robot Reviewed-by: Matthew Dempsky Auto-Submit: Cuong Manh Le --- src/cmd/compile/internal/base/flag.go | 2 +- test/fixedbugs/issue56778.go | 2 +- test/inline.go | 2 +- test/noinit.go | 2 +- 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 6eaf89efe3..a833364c66 100644 --- a/src/cmd/compile/internal/base/flag.go +++ b/src/cmd/compile/internal/base/flag.go @@ -168,7 +168,7 @@ func ParseFlags() { Debug.ConcurrentOk = true Debug.InlFuncsWithClosures = 1 - Debug.InlStaticInit = 1 + Debug.InlStaticInit = 0 Debug.SyncFrames = -1 // disable sync markers by default Debug.Checkptr = -1 // so we can tell whether it is set explicitly 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. -- cgit v1.2.1