]> Cypherpunks repositories - gostls13.git/commit
cmd/go, cmd/compile: always optimize when building runtime
authorJosh Bleecher Snyder <josharian@gmail.com>
Mon, 20 Mar 2017 16:56:50 +0000 (09:56 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 20 Mar 2017 20:54:19 +0000 (20:54 +0000)
commitf8b0231639859de7b8f1bfe7df1be0132aec9ad6
treeaed08a2c1eb6f1a359272843b77478611d7cbb87
parenta955ece6cdfb7490e184271398f0b51a0aa2ae8f
cmd/go, cmd/compile: always optimize when building runtime

When optimizations are disabled, the compiler
cannot eliminate enough write barriers to satisfy
the runtime's nowritebarrier and nowritebarrierrec
annotations.

Enforce that requirement, and for convenience,
have cmd/go elide -N when compiling the runtime.

This came up in practice for me when running
toolstash -cmp. When toolstash -cmp detected
mismatches, it recompiled with -N, which caused
runtime compilation failures.

Change-Id: Ifcdef22c725baf2c59a09470f00124361508a8f3
Reviewed-on: https://go-review.googlesource.com/38380
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/main.go
src/cmd/go/internal/work/build.go