aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/nvptx
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/nvptx')
-rw-r--r--gcc/config/nvptx/nvptx.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index d4a8f29..1bd1871 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -155,8 +155,19 @@ static void
nvptx_option_override (void)
{
init_machine_status = nvptx_init_machine_status;
- /* Gives us a predictable order, which we need especially for variables. */
- flag_toplevel_reorder = 1;
+
+ /* Set toplevel_reorder, unless explicitly disabled. We need
+ reordering so that we emit necessary assembler decls of
+ undeclared variables. */
+ if (!global_options_set.x_flag_toplevel_reorder)
+ flag_toplevel_reorder = 1;
+
+ /* Set flag_no_common, unless explicitly disabled. We fake common
+ using .weak, and that's not entirely accurate, so avoid it
+ unless forced. */
+ if (!global_options_set.x_flag_no_common)
+ flag_no_common = 1;
+
/* Assumes that it will see only hard registers. */
flag_var_tracking = 0;