From a1f427e9a5750602aca0419f947d1612729b5793 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 9 Jun 2017 18:44:28 +0000 Subject: opts.c (finish_options): If -fsplit-stack, disable implicit -forder-blocks-and-partition. gcc/: * opts.c (finish_options): If -fsplit-stack, disable implicit -forder-blocks-and-partition. * doc/invoke.texi (Optimize Options): Document that when using -fsplit-stack -forder-blocks-and-partition is not implicitly enabled. gcc/go/: * go-lang.c (go_langhook_post_options): If -fsplit-stack is turned on, disable implicit -forder-blocks-and-partition. gcc/testsuite/: * gcc.dg/tree-prof/split-1.c: New test. From-SVN: r249071 --- gcc/go/go-lang.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/go/go-lang.c') diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c index 780d737..09e4fea 100644 --- a/gcc/go/go-lang.c +++ b/gcc/go/go-lang.c @@ -304,6 +304,15 @@ go_langhook_post_options (const char **pfilename ATTRIBUTE_UNUSED) && targetm_common.supports_split_stack (false, &global_options)) global_options.x_flag_split_stack = 1; + /* If stack splitting is turned on, and the user did not explicitly + request function partitioning, turn off partitioning, as it + confuses the linker when trying to handle partitioned split-stack + code that calls a non-split-stack function. */ + if (global_options.x_flag_split_stack + && global_options.x_flag_reorder_blocks_and_partition + && !global_options_set.x_flag_reorder_blocks_and_partition) + global_options.x_flag_reorder_blocks_and_partition = 0; + /* Returning false means that the backend should be used. */ return false; } -- cgit v1.1