aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/lang.opt
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2019-05-08 00:14:17 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-05-08 00:14:17 +0000
commitf837b9c41a6ca8be317a762410fb7811b3fddde6 (patch)
treef8579ea0f1e87d926a24f76f63ead381e96c34be /gcc/go/lang.opt
parenta88158bc4daca182f0f39a2b667223d13b5a46e6 (diff)
downloadgcc-f837b9c41a6ca8be317a762410fb7811b3fddde6.zip
gcc-f837b9c41a6ca8be317a762410fb7811b3fddde6.tar.gz
gcc-f837b9c41a6ca8be317a762410fb7811b3fddde6.tar.bz2
compiler: add an option to emit optimization diagnostics
Add a -fgo-debug-optimization option to emit optimization diagnostics. This can be used for testing optimizations. Apply this to the range clear optimizations of maps and arrays. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/170002 gcc/go: * lang.opt (-fgo-debug-optimization): New option. * go-c.h (struct go_create_gogo_args): Add debug_optimization field. * go-lang.c (go_langhook_init): Set debug_optimization field. * gccgo.texi (Invoking gccgo): Document -fgo-debug-optimization. gcc/testsuite: * go.dg/arrayclear.go: New test. * go.dg/mapclear.go: New test. From-SVN: r270993
Diffstat (limited to 'gcc/go/lang.opt')
-rw-r--r--gcc/go/lang.opt4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/go/lang.opt b/gcc/go/lang.opt
index f1a81266..91b8e46 100644
--- a/gcc/go/lang.opt
+++ b/gcc/go/lang.opt
@@ -85,6 +85,10 @@ fgo-debug-escape-hash=
Go Joined RejectNegative Var(go_debug_escape_hash) Init(0)
-fgo-debug-escape-hash=<string> Hash value to debug escape analysis.
+fgo-debug-optimization
+Go Var(go_debug_optimization) Init(0)
+Emit optimization diagnostics.
+
o
Go Joined Separate
; Documented in common.opt