diff options
author | Ian Lance Taylor <iant@golang.org> | 2020-11-04 12:02:31 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2020-11-04 12:05:22 -0800 |
commit | 9a02d31baa5e83387b3bbfaadca70f4ebc6cce15 (patch) | |
tree | ea9ef12907bddf82d1d44f270d924a70a61f954b /gcc | |
parent | e86fd6a17cdb26710d1f13c9a47a3878c76028f9 (diff) | |
download | gcc-9a02d31baa5e83387b3bbfaadca70f4ebc6cce15.zip gcc-9a02d31baa5e83387b3bbfaadca70f4ebc6cce15.tar.gz gcc-9a02d31baa5e83387b3bbfaadca70f4ebc6cce15.tar.bz2 |
go: disable -fipa-icf-functions by default in Go frontend
Go programs expect to be able to get reliable backtrace information
with correct file/line information, but -fipa-icf-functions breaks
that because it merges together distinct functions which should have
distinct file/line info.
* go-lang.c (go_langhook_post_options): Disable
-fipa-icf-functions if it was not explicitly enabled.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/go-lang.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c index 2cfb410..08c1f38 100644 --- a/gcc/go/go-lang.c +++ b/gcc/go/go-lang.c @@ -306,6 +306,12 @@ go_langhook_post_options (const char **pfilename ATTRIBUTE_UNUSED) SET_OPTION_IF_UNSET (&global_options, &global_options_set, flag_partial_inlining, 0); + /* Go programs expect runtime.Callers to give the right answers, + which means that we can't combine functions even if they look the + same. */ + SET_OPTION_IF_UNSET (&global_options, &global_options_set, + flag_ipa_icf_functions, 0); + /* If the debug info level is still 1, as set in init_options, make sure that some debugging type is selected. */ if (global_options.x_debug_info_level == DINFO_LEVEL_TERSE |