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.

Change-Id: I2b128947f60f361af658e9b4e4eaf4ce61a2dcbd
Reviewed-on: https://go-review.googlesource.com/c/164378
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
1 file changed