Commit bd983a6d authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile: fix GOEXPERIMENT checks

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/80760Reviewed-by: default avatarRuss Cox <rsc@golang.org>
parent f3b24b9f
...@@ -1230,8 +1230,8 @@ func concurrentBackendAllowed() bool { ...@@ -1230,8 +1230,8 @@ func concurrentBackendAllowed() bool {
if Debug_vlog || debugstr != "" || debuglive > 0 { if Debug_vlog || debugstr != "" || debuglive > 0 {
return false return false
} }
// TODO: test and add builders for GOEXPERIMENT values, and enable // TODO: Test and delete these conditions.
if os.Getenv("GOEXPERIMENT") != "" { if objabi.Fieldtrack_enabled != 0 || objabi.Preemptibleloops_enabled != 0 || objabi.Clobberdead_enabled != 0 {
return false return false
} }
// TODO: fix races and enable the following flags // TODO: fix races and enable the following flags
......
...@@ -220,7 +220,6 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { ...@@ -220,7 +220,6 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
// TODO(rsc): Convince compiler team not to add more magic environment variables, // TODO(rsc): Convince compiler team not to add more magic environment variables,
// or perhaps restrict the environment variables passed to subprocesses. // or perhaps restrict the environment variables passed to subprocesses.
magic := []string{ magic := []string{
"GOEXPERIMENT",
"GOCLOBBERDEADHASH", "GOCLOBBERDEADHASH",
"GOSSAFUNC", "GOSSAFUNC",
"GO_SSA_PHI_LOC_CUTOFF", "GO_SSA_PHI_LOC_CUTOFF",
......
...@@ -147,11 +147,6 @@ func gcBackendConcurrency(gcflags []string) int { ...@@ -147,11 +147,6 @@ func gcBackendConcurrency(gcflags []string) int {
log.Fatalf("GO19CONCURRENTCOMPILATION must be 0, 1, or unset, got %q", e) 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: CheckFlags:
for _, flag := range gcflags { for _, flag := range gcflags {
// Concurrent compilation is presumed incompatible with any gcflags, // Concurrent compilation is presumed incompatible with any gcflags,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment