diff options
author | Cherry Zhang <cherryyz@google.com> | 2019-05-08 00:14:17 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-05-08 00:14:17 +0000 |
commit | f837b9c41a6ca8be317a762410fb7811b3fddde6 (patch) | |
tree | f8579ea0f1e87d926a24f76f63ead381e96c34be /gcc/go/gccgo.texi | |
parent | a88158bc4daca182f0f39a2b667223d13b5a46e6 (diff) | |
download | gcc-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/gccgo.texi')
-rw-r--r-- | gcc/go/gccgo.texi | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/go/gccgo.texi b/gcc/go/gccgo.texi index 23101954..92fd745 100644 --- a/gcc/go/gccgo.texi +++ b/gcc/go/gccgo.texi @@ -246,6 +246,11 @@ This runs escape analysis only on functions whose names hash to values that match the given suffix @var{n}. This can be used to binary search across functions to uncover escape analysis bugs. +@item -fgo-debug-optimization +@cindex @option{-fgo-debug-optimization} +@cindex @option{-fno-go-debug-optimization} +Output optimization diagnostics. + @item -fgo-c-header=@var{file} @cindex @option{-fgo-c-header} Write top-level named Go struct definitions to @var{file} as C code. |