]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/compile: disable inline static init optimization
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 9 Feb 2023 19:13:05 +0000 (02:13 +0700)
committerGopher Robot <gobot@golang.org>
Thu, 9 Feb 2023 19:49:12 +0000 (19:49 +0000)
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 <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>

src/cmd/compile/internal/base/flag.go
test/fixedbugs/issue56778.go
test/inline.go
test/noinit.go

index 6eaf89efe3df6c71ca4581ac3826eca03586e472..a833364c662324d219ae9fc17fcdafdec7d6d336 100644 (file)
@@ -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
index 8bb5c3e21398f4d28cfb34ab6acd869926063c1c..3c27501fd27d870ae047fc6524d3448b7a0f08e1 100644 (file)
@@ -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
index cf2cd8cd60326e537ce28188feba0783e5189b88..1aa8fccbbdc62509d2f23789c680137ab4491d0d 100644 (file)
@@ -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
index ed8e572e511121d492b15c8a0575ce0d38012a04..505467cf8f332631648889c2a4b94fae16cb888a 100644 (file)
@@ -1,4 +1,4 @@
-// run
+// run -gcflags=-d=inlstaticinit=1
 //go:build !gcflags_noopt
 
 // Copyright 2010 The Go Authors. All rights reserved.