aboutsummaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index 7e8e96c..0533c9fa 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -849,15 +849,28 @@ decode_options (unsigned int argc, const char **argv)
}
}
- if (!optimize)
+
+ if (!flag_unit_at_a_time)
{
- flag_merge_constants = 0;
+ flag_section_anchors = 0;
+ flag_toplevel_reorder = 0;
+ flag_unit_at_a_time = 1;
+ }
+ if (!flag_toplevel_reorder)
+ {
+ if (flag_section_anchors == 1)
+ error ("Section anchors must be disabled when toplevel reorder is disabled.");
+ flag_section_anchors = 0;
}
- if (!no_unit_at_a_time_default)
+ if (!optimize)
{
- flag_unit_at_a_time = 1;
- if (!optimize)
+ flag_merge_constants = 0;
+
+ /* We disable toplevel reordering at -O0 to disable transformations that
+ might be surprising to end users and to get -fno-toplevel-reorder
+ tested, but we keep section anchors. */
+ if (flag_toplevel_reorder == 2)
flag_toplevel_reorder = 0;
}