]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: fix GOEXPERIMENT checks
authorMatthew Dempsky <mdempsky@google.com>
Wed, 29 Nov 2017 20:26:59 +0000 (12:26 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 1 Dec 2017 00:40:45 +0000 (00:40 +0000)
GOEXPERIMENT is only set during make.bash, so checking the environment
variable isn't effectual. Instead, check the values exposed by objabi.

These experiments look potentially safe, but it seems too late in the
release cycle to try to assuage that. The one exception is frame
pointer experiment, which is trivially safe: it just amounts to
incrementing some stack offsets by PtrSize.

Fixes #22223.

Change-Id: I46dc7c54b1347143d02d6b9635038230cda6d164
Reviewed-on: https://go-review.googlesource.com/80760
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/compile/internal/gc/main.go
src/cmd/go/internal/work/exec.go
src/cmd/go/internal/work/gc.go

index 4e470b6d8d2e6b414b2c42c2e1cf602f591ba974..b651c9acb3a0fc24c2f91dba3d006ac53c4f933c 100644 (file)
@@ -1230,8 +1230,8 @@ func concurrentBackendAllowed() bool {
        if Debug_vlog || debugstr != "" || debuglive > 0 {
                return false
        }
-       // TODO: test and add builders for GOEXPERIMENT values, and enable
-       if os.Getenv("GOEXPERIMENT") != "" {
+       // TODO: Test and delete these conditions.
+       if objabi.Fieldtrack_enabled != 0 || objabi.Preemptibleloops_enabled != 0 || objabi.Clobberdead_enabled != 0 {
                return false
        }
        // TODO: fix races and enable the following flags
index 067b20a217cf75bc3233267b3fd804ba6fcad9b4..2e170fa040ade0d17dd93e1ee62716c1c1890973 100644 (file)
@@ -220,7 +220,6 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
                // TODO(rsc): Convince compiler team not to add more magic environment variables,
                // or perhaps restrict the environment variables passed to subprocesses.
                magic := []string{
-                       "GOEXPERIMENT",
                        "GOCLOBBERDEADHASH",
                        "GOSSAFUNC",
                        "GO_SSA_PHI_LOC_CUTOFF",
index 4a181d9730095ad5be56a288e6fd4657c152c84d..eaa54d106f636b1506e13e597685f36bd5476064 100644 (file)
@@ -147,11 +147,6 @@ func gcBackendConcurrency(gcflags []string) int {
                log.Fatalf("GO19CONCURRENTCOMPILATION must be 0, 1, or unset, got %q", e)
        }
 
-       if os.Getenv("GOEXPERIMENT") != "" {
-               // Concurrent compilation is presumed incompatible with GOEXPERIMENTs.
-               canDashC = false
-       }
-
 CheckFlags:
        for _, flag := range gcflags {
                // Concurrent compilation is presumed incompatible with any gcflags,