aboutsummaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2017-06-09 18:44:28 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-06-09 18:44:28 +0000
commita1f427e9a5750602aca0419f947d1612729b5793 (patch)
treecc12d6764d5fc554e61f0f5dafc58ce91099a908 /gcc/opts.c
parentcb59f689a37fc39178b9ac5fa595c63b3d7eddc0 (diff)
downloadgcc-a1f427e9a5750602aca0419f947d1612729b5793.zip
gcc-a1f427e9a5750602aca0419f947d1612729b5793.tar.gz
gcc-a1f427e9a5750602aca0419f947d1612729b5793.tar.bz2
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
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index ac409f4..5ec9980 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -863,6 +863,16 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
opts->x_flag_reorder_blocks = 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 functions. But if partitioning
+ was turned on explicitly just hope for the best. */
+ if (opts->x_flag_split_stack
+ && opts->x_flag_reorder_blocks_and_partition
+ && !opts_set->x_flag_reorder_blocks_and_partition)
+ opts->x_flag_reorder_blocks_and_partition = 0;
+
if (opts->x_flag_reorder_blocks_and_partition
&& !opts_set->x_flag_reorder_functions)
opts->x_flag_reorder_functions = 1;