From 0a587f65653b553099daff424f1d2d1dca7393cb Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Sat, 16 Oct 2010 13:12:24 +0100 Subject: [PATCH] arm.c (arm_option_optimization): Set flag_section_anchors to 1 not 2. * config/arm/arm.c (arm_option_optimization): Set flag_section_anchors to 1 not 2. * config/i386/i386.c (ix86_option_override_internal): Check global_options_set.x_flag_zee and global_options_set.x_flag_omit_frame_pointer. (ix86_option_optimization): Don't set flag_omit_frame_pointer and flag_zee to 2. * config/i386/sol2-10.h (SUBTARGET_OVERRIDE_OPTIONS): Check global_options_set.x_flag_omit_frame_pointer. * config/rs6000/rs6000.c (rs6000_option_init_struct): Set opts->x_flag_section_anchors to 1 not 2. * config/sh/sh.c (sh_option_optimization): Don't set flag_schedule_insns to 2. (sh_option_override): Check global_options_set.x_flag_schedule_insns. * opts.c (finish_options): Check opts_set->x_flag_section_anchors. From-SVN: r165539 --- gcc/ChangeLog | 19 +++++++++++++++++++ gcc/config/arm/arm.c | 6 ++---- gcc/config/i386/i386.c | 20 +++----------------- gcc/config/i386/sol2-10.h | 2 +- gcc/config/rs6000/rs6000.c | 2 +- gcc/config/sh/sh.c | 9 +++------ gcc/opts.c | 8 +++++--- 7 files changed, 34 insertions(+), 32 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 16aa3df596c..55d179fe8e2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,22 @@ +2010-10-16 Joseph Myers + + * config/arm/arm.c (arm_option_optimization): Set + flag_section_anchors to 1 not 2. + * config/i386/i386.c (ix86_option_override_internal): Check + global_options_set.x_flag_zee and + global_options_set.x_flag_omit_frame_pointer. + (ix86_option_optimization): Don't set flag_omit_frame_pointer and + flag_zee to 2. + * config/i386/sol2-10.h (SUBTARGET_OVERRIDE_OPTIONS): Check + global_options_set.x_flag_omit_frame_pointer. + * config/rs6000/rs6000.c (rs6000_option_init_struct): Set + opts->x_flag_section_anchors to 1 not 2. + * config/sh/sh.c (sh_option_optimization): Don't set + flag_schedule_insns to 2. + (sh_option_override): Check + global_options_set.x_flag_schedule_insns. + * opts.c (finish_options): Check opts_set->x_flag_section_anchors. + 2010-10-16 Kai Tietz * configure.ac: Make sure inhibit_libc remains false for mingw targets diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 3bcd1a9cb2c..4f6bea1c0f6 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -22823,11 +22823,9 @@ arm_order_regs_for_local_alloc (void) static void arm_option_optimization (int level, int size ATTRIBUTE_UNUSED) { - /* Enable section anchors by default at -O1 or higher. - Use 2 to distinguish from an explicit -fsection-anchors - given on the command line. */ + /* Enable section anchors by default at -O1 or higher. */ if (level > 0) - flag_section_anchors = 2; + flag_section_anchors = 1; } /* Implement TARGET_FRAME_POINTER_REQUIRED. */ diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 4536ef22ea8..cf70018675c 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3276,9 +3276,9 @@ ix86_option_override_internal (bool main_args_p) in case they weren't overwritten by command line options. */ if (TARGET_64BIT) { - if (flag_zee == 2) + if (optimize > 1 && !global_options_set.x_flag_zee) flag_zee = 1; - if (flag_omit_frame_pointer == 2) + if (optimize >= 1 && !global_options_set.x_flag_omit_frame_pointer) flag_omit_frame_pointer = 1; if (flag_asynchronous_unwind_tables == 2) flag_asynchronous_unwind_tables = 1; @@ -3287,9 +3287,7 @@ ix86_option_override_internal (bool main_args_p) } else { - if (flag_zee == 2) - flag_zee = 0; - if (flag_omit_frame_pointer == 2) + if (optimize >= 1 && !global_options_set.x_flag_omit_frame_pointer) flag_omit_frame_pointer = !(USE_IX86_FRAME_POINTER || optimize_size); if (flag_asynchronous_unwind_tables == 2) flag_asynchronous_unwind_tables = !USE_IX86_FRAME_POINTER; @@ -4537,18 +4535,6 @@ ix86_option_optimization (int level, int size ATTRIBUTE_UNUSED) flag_schedule_insns = 0; #endif - /* The default values of these switches depend on the TARGET_64BIT - that is not known at this moment. Mark these values with 2 and - let user the to override these. In case there is no command line - option specifying them, we will set the defaults in - ix86_option_override_internal. */ - if (optimize >= 1) - flag_omit_frame_pointer = 2; - - /* For -O2 and beyond, turn on -fzee for x86_64 target. */ - if (level > 1) - flag_zee = 2; - #ifdef SUBTARGET_OPTIMIZATION_OPTIONS SUBTARGET_OPTIMIZATION_OPTIONS; #endif diff --git a/gcc/config/i386/sol2-10.h b/gcc/config/i386/sol2-10.h index d4f6450be01..e972ece3b7e 100644 --- a/gcc/config/i386/sol2-10.h +++ b/gcc/config/i386/sol2-10.h @@ -84,7 +84,7 @@ along with GCC; see the file COPYING3. If not see #define SUBTARGET_OVERRIDE_OPTIONS \ do \ { \ - if (flag_omit_frame_pointer == 2) \ + if (!global_options_set.x_flag_omit_frame_pointer) \ flag_omit_frame_pointer = 0; \ } \ while (0) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index a1baa592fa9..69c3969b451 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3693,7 +3693,7 @@ rs6000_option_init_struct (struct gcc_options *opts) /* Enable section anchors by default. */ if (!TARGET_MACHO) - opts->x_flag_section_anchors = 2; + opts->x_flag_section_anchors = 1; } /* Implement TARGET_OPTION_DEFAULT_PARAMS. */ diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 41cc8b7a8a6..9850969dc4c 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -728,10 +728,6 @@ sh_option_optimization (int level, int size) if (!size) target_flags |= MASK_SAVE_ALL_TARGET_REGS; } - /* If flag_schedule_insns is 1, we set it to 2 here so we know if - the user explicitly requested this to be on or off. */ - if (flag_schedule_insns > 0) - flag_schedule_insns = 2; } /* Implement TARGET_OPTION_INIT_STRUCT. */ @@ -932,11 +928,12 @@ sh_option_override (void) . */ else if (flag_exceptions) { - if (flag_schedule_insns == 1) + if (flag_schedule_insns && global_options_set.x_flag_schedule_insns) warning (0, "ignoring -fschedule-insns because of exception handling bug"); flag_schedule_insns = 0; } - else if (flag_schedule_insns == 2) + else if (flag_schedule_insns + && !global_options_set.x_flag_schedule_insns) flag_schedule_insns = 0; } diff --git a/gcc/opts.c b/gcc/opts.c index 81514ba7075..69d13596712 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -1005,7 +1005,7 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set) section-anchors. */ if (!flag_unit_at_a_time) { - if (flag_section_anchors == 1) + if (flag_section_anchors && opts_set->x_flag_section_anchors) error ("Section anchors must be disabled when unit-at-a-time " "is disabled."); flag_section_anchors = 0; @@ -1022,14 +1022,16 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set) /* Unless the user has asked for section anchors, we disable toplevel reordering at -O0 to disable transformations that might be surprising to end users and to get -fno-toplevel-reorder tested. */ - if (!optimize && flag_toplevel_reorder == 2 && flag_section_anchors != 1) + if (!optimize + && flag_toplevel_reorder == 2 + && !(flag_section_anchors && opts_set->x_flag_section_anchors)) { flag_toplevel_reorder = 0; flag_section_anchors = 0; } if (!flag_toplevel_reorder) { - if (flag_section_anchors == 1) + if (flag_section_anchors && opts_set->x_flag_section_anchors) error ("section anchors must be disabled when toplevel reorder" " is disabled"); flag_section_anchors = 0; -- 2.30.2