compiler: turn on escape analysis by default
The escape analysis now runs by default. It can be disabled with
the negative flag, -fno-go-optimize-allocs.
Corresponding change in the GCC backend:
Index: gcc/go/go-c.h
===================================================================
--- gcc/go/go-c.h (revision 257310)
+++ gcc/go/go-c.h (working copy)
@@ -29,7 +29,7 @@
interface. */
extern int go_enable_dump (const char*);
-extern int go_enable_optimize (const char*);
+extern int go_enable_optimize (const char*, int);
extern void go_add_search_path (const char*);
Index: gcc/go/go-lang.c
===================================================================
--- gcc/go/go-lang.c (revision 257310)
+++ gcc/go/go-lang.c (working copy)
@@ -194,7 +194,7 @@
go_langhook_handle_option (
size_t scode,
const char *arg,
- int value ATTRIBUTE_UNUSED,
+ int value,
int kind ATTRIBUTE_UNUSED,
location_t loc ATTRIBUTE_UNUSED,
const struct cl_option_handlers *handlers ATTRIBUTE_UNUSED)
@@ -251,7 +251,7 @@
break;
case OPT_fgo_optimize_:
- ret = go_enable_optimize (arg) ? true : false;
+ ret = go_enable_optimize (arg, value) ? true : false;
break;
case OPT_fgo_pkgpath_:
Index: gcc/go/lang.opt
===================================================================
--- gcc/go/lang.opt (revision 257310)
+++ gcc/go/lang.opt (working copy)
@@ -58,7 +58,7 @@
-fgo-dump-<type> Dump Go frontend internal information.
fgo-optimize-
-Go Joined RejectNegative
+Go Joined
-fgo-optimize-<type> Turn on optimization passes in the frontend.
fgo-pkgpath=
Change-Id: I7f54f6b762473151b02abb6e6b2137e2a673553f
Reviewed-on: https://go-review.googlesource.com/86247
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 files changed