+ if (diagnostic->kind == DK_ICE)
+ {
+#ifndef ENABLE_CHECKING
+ /* When not checking, ICEs are converted to fatal errors when an
+ error has already occurred. This is counteracted by
+ abort_on_error. */
+ if ((diagnostic_kind_count (context, DK_ERROR) > 0
+ || diagnostic_kind_count (context, DK_SORRY) > 0)
+ && !context->abort_on_error)
+ {
+ expanded_location s = expand_location (diagnostic->location);
+ fnotice (stderr, "%s:%d: confused by earlier errors, bailing out\n",
+ s.file, s.line);
+ exit (ICE_EXIT_CODE);
+ }
+#endif
+ if (context->internal_error)
+ (*context->internal_error) (diagnostic->message.format_spec,
+ diagnostic->message.args_ptr);
+ }
+ ++diagnostic_kind_count (context, diagnostic->kind);
+
+ saved_format_spec = diagnostic->message.format_spec;
+ if (context->show_option_requested)
+ {
+ const char * option_text = NULL;
+
+ if (diagnostic->option_index)
+ {
+ /* A warning classified as an error. */
+ if ((orig_diag_kind == DK_WARNING || orig_diag_kind == DK_PEDWARN)
+ && diagnostic->kind == DK_ERROR)
+ option_text
+ = ACONCAT ((cl_options[OPT_Werror_].opt_text,
+ /* Skip over "-W". */
+ cl_options[diagnostic->option_index].opt_text + 2,
+ NULL));
+ /* A warning with option. */
+ else
+ option_text = cl_options[diagnostic->option_index].opt_text;
+ }
+ /* A warning without option classified as an error. */
+ else if (orig_diag_kind == DK_WARNING || orig_diag_kind == DK_PEDWARN
+ || diagnostic->kind == DK_WARNING)
+ {
+ if (context->warning_as_error_requested)
+ option_text = cl_options[OPT_Werror].opt_text;
+ else
+ option_text = _("enabled by default");
+ }
+
+ if (option_text)