diff options
Diffstat (limited to 'gcc/opts.cc')
-rw-r--r-- | gcc/opts.cc | 54 |
1 files changed, 35 insertions, 19 deletions
diff --git a/gcc/opts.cc b/gcc/opts.cc index 80c7a97..6ca1ec7 100644 --- a/gcc/opts.cc +++ b/gcc/opts.cc @@ -1037,6 +1037,25 @@ report_conflicting_sanitizer_options (struct gcc_options *opts, location_t loc, } } +/* Validate from OPTS and OPTS_SET that when -fipa-reorder-for-locality is + enabled no explicit -flto-partition is also passed as the locality cloning + pass uses its own partitioning scheme. */ + +static void +validate_ipa_reorder_locality_lto_partition (struct gcc_options *opts, + struct gcc_options *opts_set) +{ + static bool validated_p = false; + + if (opts_set->x_flag_lto_partition) + { + if (opts->x_flag_ipa_reorder_for_locality && !validated_p) + error ("%<-fipa-reorder-for-locality%> is incompatible with" + " an explicit %qs option", "-flto-partition"); + } + validated_p = true; +} + /* After all options at LOC have been read into OPTS and OPTS_SET, finalize settings of those options and diagnose incompatible combinations. */ @@ -1249,6 +1268,8 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, if (opts->x_flag_reorder_blocks_and_partition) SET_OPTION_IF_UNSET (opts, opts_set, flag_reorder_functions, 1); + validate_ipa_reorder_locality_lto_partition (opts, opts_set); + /* The -gsplit-dwarf option requires -ggnu-pubnames. */ if (opts->x_dwarf_split_debug_info) opts->x_debug_generate_pub_sections = 2; @@ -1363,16 +1384,8 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, || opts->x_flag_peel_loops || opts->x_optimize >= 3); - /* With -fcx-limited-range, we do cheap and quick complex arithmetic. */ - if (opts->x_flag_cx_limited_range) - opts->x_flag_complex_method = 0; - else if (opts_set->x_flag_cx_limited_range) - opts->x_flag_complex_method = opts->x_flag_default_complex_method; - - /* With -fcx-fortran-rules, we do something in-between cheap and C99. */ - if (opts->x_flag_cx_fortran_rules) - opts->x_flag_complex_method = 1; - else if (opts_set->x_flag_cx_fortran_rules) + /* Use a frontend provided default for the complex eval method. */ + if (!opts_set->x_flag_complex_method) opts->x_flag_complex_method = opts->x_flag_default_complex_method; /* Use -fvect-cost-model=cheap instead of -fvect-cost-mode=very-cheap @@ -2067,10 +2080,13 @@ print_specific_help (unsigned int include_flags, static void enable_fdo_optimizations (struct gcc_options *opts, struct gcc_options *opts_set, - int value) + int value, bool autofdo) { - SET_OPTION_IF_UNSET (opts, opts_set, flag_branch_probabilities, value); - SET_OPTION_IF_UNSET (opts, opts_set, flag_profile_values, value); + if (!autofdo) + { + SET_OPTION_IF_UNSET (opts, opts_set, flag_branch_probabilities, value); + SET_OPTION_IF_UNSET (opts, opts_set, flag_profile_values, value); + } SET_OPTION_IF_UNSET (opts, opts_set, flag_unroll_loops, value); SET_OPTION_IF_UNSET (opts, opts_set, flag_peel_loops, value); SET_OPTION_IF_UNSET (opts, opts_set, flag_tracer, value); @@ -2859,7 +2875,7 @@ common_handle_option (struct gcc_options *opts, break; case OPT_Wfatal_errors: - dc->m_fatal_errors = value; + dc->set_fatal_errors (value); break; case OPT_Wstack_usage_: @@ -3111,7 +3127,7 @@ common_handle_option (struct gcc_options *opts, /* No break here - do -fprofile-use processing. */ /* FALLTHRU */ case OPT_fprofile_use: - enable_fdo_optimizations (opts, opts_set, value); + enable_fdo_optimizations (opts, opts_set, value, false); SET_OPTION_IF_UNSET (opts, opts_set, flag_profile_reorder_functions, value); /* Indirect call profiling should do all useful transformations @@ -3128,7 +3144,7 @@ common_handle_option (struct gcc_options *opts, /* No break here - do -fauto-profile processing. */ /* FALLTHRU */ case OPT_fauto_profile: - enable_fdo_optimizations (opts, opts_set, value); + enable_fdo_optimizations (opts, opts_set, value, true); SET_OPTION_IF_UNSET (opts, opts_set, flag_profile_correction, value); break; @@ -3444,8 +3460,8 @@ set_fast_math_flags (struct gcc_options *opts, int set) opts->x_flag_signaling_nans = 0; if (!opts->frontend_set_flag_rounding_math) opts->x_flag_rounding_math = 0; - if (!opts->frontend_set_flag_cx_limited_range) - opts->x_flag_cx_limited_range = 1; + if (!opts->frontend_set_flag_complex_method) + opts->x_flag_complex_method = 0; } } @@ -3615,7 +3631,7 @@ setup_core_dumping (diagnostic_context *dc) "setting core file size limit to maximum: %m"); } #endif - diagnostic_abort_on_error (dc); + dc->set_abort_on_error (true); } /* Parse a -d<ARG> command line switch for OPTS, location LOC, |