flag_if_conversion2 = opt1;
flag_ipa_pure_const = opt1;
flag_ipa_reference = opt1;
+ flag_ipa_profile = opt1;
flag_merge_constants = opt1;
flag_split_wide_types = opt1;
flag_tree_ccp = opt1;
else
set_param_value ("min-crossjump-insns", initial_min_crossjump_insns);
+ /* Enable -Werror=coverage-mismatch by default */
+ enable_warning_as_error("coverage-mismatch", 1, lang_mask);
+
if (first_time_p)
{
/* Initialize whether `char' is signed. */
if (!PARAM_SET_P (PARAM_STACK_FRAME_GROWTH))
PARAM_VALUE (PARAM_STACK_FRAME_GROWTH) = 40;
}
+ if (flag_wpa || flag_ltrans)
+ {
+ /* These passes are not WHOPR compatible yet. */
+ flag_ipa_cp = 0;
+ flag_ipa_reference = 0;
+ flag_ipa_type_escape = 0;
+ flag_ipa_pta = 0;
+ flag_ipa_struct_reorg = 0;
+ }
if (flag_lto || flag_whopr)
{
break;
case OPT_fdiagnostics_show_option:
- global_dc->show_option_requested = true;
+ global_dc->show_option_requested = value;
break;
case OPT_fdump_:
}
}
+
+/* Callback function, called when -Werror= enables a warning. */
+
+static void (*warning_as_error_callback) (int) = NULL;
+
+/* Register a callback for enable_warning_as_error calls. */
+
+void
+register_warning_as_error_callback (void (*callback) (int))
+{
+ gcc_assert (warning_as_error_callback == NULL || callback == NULL);
+ warning_as_error_callback = callback;
+}
+
/* Enable a warning option as an error. This is used by -Werror= and
also by legacy Werror-implicit-function-declaration. */
}
else
{
- diagnostic_t kind = value ? DK_ERROR : DK_WARNING;
+ const diagnostic_t kind = value ? DK_ERROR : DK_WARNING;
+
diagnostic_classify_diagnostic (global_dc, option_index, kind);
+ if (kind == DK_ERROR)
+ {
+ const struct cl_option * const option = cl_options + option_index;
+
+ /* -Werror=foo implies -Wfoo. */
+ if (option->var_type == CLVC_BOOLEAN && option->flag_var)
+ *(int *) option->flag_var = 1;
- /* -Werror=foo implies -Wfoo. */
- if (cl_options[option_index].var_type == CLVC_BOOLEAN
- && cl_options[option_index].flag_var
- && kind == DK_ERROR)
- *(int *) cl_options[option_index].flag_var = 1;
+ if (warning_as_error_callback)
+ warning_as_error_callback (option_index);
+ }
}
free (new_option);
}