opts.c (finish_options): Move test for flag_split_stack after it has been initialized.
authorJan Hubicka <hubicka@ucw.cz>
Sun, 11 Jun 2017 09:33:22 +0000 (11:33 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 11 Jun 2017 09:33:22 +0000 (09:33 +0000)
* opts.c (finish_options): Move test for flag_split_stack after
it has been initialized.

From-SVN: r249105

gcc/ChangeLog
gcc/opts.c

index 8ddc0ee46924e142efb8722ff2db8ccd3df1386d..c3bd0402b25c387432235c70ab25d7ca75d45f97 100644 (file)
@@ -1,3 +1,8 @@
+2017-06-10  Jan Hubicka  <hubicka@ucw.cz>
+
+       * opts.c (finish_options): Move test for flag_split_stack after
+       it has been initialized.
+
 2017-06-11  Jason Merrill  <jason@redhat.com>
 
        * tree.h (id_equal): New.
index 5ec99807f227118fe698f0c41c18dcdcf9c7acec..60ebe56c8a4e65d9074e6774e9daa571b14d6f38 100644 (file)
@@ -863,19 +863,6 @@ 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;
 
   /* Pipelining of outer loops is only possible when general pipelining
      capabilities are requested.  */
@@ -927,6 +914,20 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
        }
     }
 
+  /* 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;
+
   /* Tune vectorization related parametees according to cost model.  */
   if (opts->x_flag_vect_cost_model == VECT_COST_MODEL_CHEAP)
     {