Commit 3eba0988 by Ian Lance Taylor

cmd/go: add -O2 to invocation of gccgo

    
    When using the go tool with gccgo, this changes the default
    compilation to use -O2.  The -gccgoflags option can be used to
    override this default.  I think this change better corresponds to what
    people expect when using the go tool.
    
    Reviewed-on: https://go-review.googlesource.com/c/164378

From-SVN: r269299
parent 5b2eaa11
66ac9466852d11e968f8fd2ad6ffc7386cee49e1 d5e4595784fb744f5fa0e0f90e77de9b5448b793
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -76,7 +76,7 @@ func (tools gccgoToolchain) gc(b *Builder, a *Action, archive string, importcfg ...@@ -76,7 +76,7 @@ func (tools gccgoToolchain) gc(b *Builder, a *Action, archive string, importcfg
gcargs = append(gcargs, "-fgo-relative-import-path="+p.Internal.LocalPrefix) gcargs = append(gcargs, "-fgo-relative-import-path="+p.Internal.LocalPrefix)
} }
args := str.StringList(tools.compiler(), "-c", gcargs, "-o", ofile, forcedGccgoflags) args := str.StringList(tools.compiler(), "-c", "-O2", gcargs, "-o", ofile, forcedGccgoflags)
if importcfg != nil { if importcfg != nil {
if b.gccSupportsFlag(args[:1], "-fgo-importcfg=/dev/null") { if b.gccSupportsFlag(args[:1], "-fgo-importcfg=/dev/null") {
if err := b.writeFile(objdir+"importcfg", importcfg); err != nil { if err := b.writeFile(objdir+"importcfg", importcfg); err != nil {
......
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