]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: reenable inlstaticinit
authorRuss Cox <rsc@golang.org>
Tue, 22 Nov 2022 18:28:51 +0000 (13:28 -0500)
committerGopher Robot <gobot@golang.org>
Wed, 23 Nov 2022 21:54:55 +0000 (21:54 +0000)
This was disabled in CL 452676 out of an abundance of caution,
but further analysis has shown that the failures were not being
caused by this optimization. Instead the sequence of commits was:

CL 450136 cmd/compile: handle simple inlined calls in staticinit
...
CL 449937 archive/tar, archive/zip: return ErrInsecurePath for unsafe paths
...
CL 451555 cmd/compile: fix static init for inlined calls

The failures in question became compile failures in the first CL
and started building again after the last CL.
But in the interim the code had been broken by the middle CL.
CL 451555 was just the first time that the tests could run and fail.

For #30820.

Change-Id: I65064032355b56fdb43d9731be2f9f32ef6ee600
Reviewed-on: https://go-review.googlesource.com/c/go/+/452817
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

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

index 4667fdb1da98767c999d8a5061768cf9edec2d47..ee42696ad270a1be99480269ebbf52d44890fc8f 100644 (file)
@@ -31,7 +31,7 @@ type DebugFlags struct {
        GCProg                int    `help:"print dump of GC programs"`
        Gossahash             string `help:"hash value for use in debugging the compiler"`
        InlFuncsWithClosures  int    `help:"allow functions with closures to be inlined" concurrent:"ok"`
-       InlStaticInit         int    `help:"allow static initialization of inlined calls"`
+       InlStaticInit         int    `help:"allow static initialization of inlined calls" concurrent:"ok"`
        InterfaceCycles       int    `help:"allow anonymous interface cycles"`
        Libfuzzer             int    `help:"enable coverage instrumentation for libfuzzer"`
        LocationLists         int    `help:"print information about DWARF location list creation"`
index 1546c277fd34d9a5121022dfbe731908264b5b3f..8cb7e96d14b8da62870d5bb5c6496335d0a0d730 100644 (file)
@@ -167,7 +167,7 @@ func ParseFlags() {
 
        Debug.ConcurrentOk = true
        Debug.InlFuncsWithClosures = 1
-       Debug.InlStaticInit = 0
+       Debug.InlStaticInit = 1
        if buildcfg.Experiment.Unified {
                Debug.Unified = 1
        }
index 3c27501fd27d870ae047fc6524d3448b7a0f08e1..8bb5c3e21398f4d28cfb34ab6acd869926063c1c 100644 (file)
@@ -1,4 +1,4 @@
-// compiledir -d=inlstaticinit=1
+// compiledir
 
 // Copyright 2022 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 1aa8fccbbdc62509d2f23789c680137ab4491d0d..cf2cd8cd60326e537ce28188feba0783e5189b88 100644 (file)
@@ -1,4 +1,4 @@
-// errorcheckwithauto -0 -m -d=inlfuncswithclosures=1 -d=inlstaticinit=1
+// errorcheckwithauto -0 -m -d=inlfuncswithclosures=1
 
 // Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 505467cf8f332631648889c2a4b94fae16cb888a..ed8e572e511121d492b15c8a0575ce0d38012a04 100644 (file)
@@ -1,4 +1,4 @@
-// run -gcflags=-d=inlstaticinit=1
+// run
 //go:build !gcflags_noopt
 
 // Copyright 2010 The Go Authors. All rights reserved.