From 20c2121a1bd2f4e4d5edcd71ce48746c1fec4e04 Mon Sep 17 00:00:00 2001 From: jsm28 Date: Wed, 11 May 2011 11:11:34 +0000 Subject: [PATCH] * opts.c (finish_options): Move warning settings from process_options. * toplev.c (process_options): Move warning settings to finish_options. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173651 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/opts.c | 25 +++++++++++++++++++++++++ gcc/toplev.c | 23 ----------------------- 3 files changed, 32 insertions(+), 23 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 98795b8cdf9..cbe38aa4d4d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-05-11 Joseph Myers + + * opts.c (finish_options): Move warning settings from + process_options. + * toplev.c (process_options): Move warning settings to + finish_options. + 2011-05-11 Richard Guenther PR tree-optimization/18041 diff --git a/gcc/opts.c b/gcc/opts.c index f00e1b2a6df..356f093192f 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -807,6 +807,31 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, if (!opts->x_flag_tree_vectorize || !opts->x_flag_tree_loop_if_convert) maybe_set_param_value (PARAM_MAX_STORES_TO_SINK, 0, opts->x_param_values, opts_set->x_param_values); + + /* This replaces set_Wunused. */ + if (opts->x_warn_unused_function == -1) + opts->x_warn_unused_function = opts->x_warn_unused; + if (opts->x_warn_unused_label == -1) + opts->x_warn_unused_label = opts->x_warn_unused; + /* Wunused-parameter is enabled if both -Wunused -Wextra are enabled. */ + if (opts->x_warn_unused_parameter == -1) + opts->x_warn_unused_parameter = (opts->x_warn_unused + && opts->x_extra_warnings); + if (opts->x_warn_unused_variable == -1) + opts->x_warn_unused_variable = opts->x_warn_unused; + /* Wunused-but-set-parameter is enabled if both -Wunused -Wextra are + enabled. */ + if (opts->x_warn_unused_but_set_parameter == -1) + opts->x_warn_unused_but_set_parameter = (opts->x_warn_unused + && opts->x_extra_warnings); + if (opts->x_warn_unused_but_set_variable == -1) + opts->x_warn_unused_but_set_variable = opts->x_warn_unused; + if (opts->x_warn_unused_value == -1) + opts->x_warn_unused_value = opts->x_warn_unused; + + /* This replaces set_Wextra. */ + if (opts->x_warn_uninitialized == -1) + opts->x_warn_uninitialized = opts->x_extra_warnings; } #define LEFT_COLUMN 27 diff --git a/gcc/toplev.c b/gcc/toplev.c index d61addedfad..d0024273265 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1253,29 +1253,6 @@ process_options (void) maximum_field_alignment = initial_max_fld_align * BITS_PER_UNIT; - /* This replaces set_Wunused. */ - if (warn_unused_function == -1) - warn_unused_function = warn_unused; - if (warn_unused_label == -1) - warn_unused_label = warn_unused; - /* Wunused-parameter is enabled if both -Wunused -Wextra are enabled. */ - if (warn_unused_parameter == -1) - warn_unused_parameter = (warn_unused && extra_warnings); - if (warn_unused_variable == -1) - warn_unused_variable = warn_unused; - /* Wunused-but-set-parameter is enabled if both -Wunused -Wextra are - enabled. */ - if (warn_unused_but_set_parameter == -1) - warn_unused_but_set_parameter = (warn_unused && extra_warnings); - if (warn_unused_but_set_variable == -1) - warn_unused_but_set_variable = warn_unused; - if (warn_unused_value == -1) - warn_unused_value = warn_unused; - - /* This replaces set_Wextra. */ - if (warn_uninitialized == -1) - warn_uninitialized = extra_warnings; - /* Allow the front end to perform consistency checks and do further initialization based on the command line options. This hook also sets the original filename if appropriate (e.g. foo.i -> foo.c) -- 2.11.0