+2014-11-25 Tobias Burnus <burnus@net-b.de>
+
+ * error.c (gfc_internal_error): Convert to common diagnostics.
+ * interface.c (gfc_find_sym_in_symtree): Use %qs.
+ * intrinsic.c (make_generic, gfc_check_intrinsic_standard,
+ gfc_convert_type_warn): Ditto.
+ * module.c (write_symbol): Ditto.
+ * symbol.c (gfc_get_default_type): Ditto; use fatal instead
+ of internal error.
+ * trans-array.c (gfc_walk_subexpr): Replace internal_error by
+ gfc_internal_error.
+ * trans-decl.c (gfc_get_symbol_decl,
+ (gfc_create_module_variable): Ditto. Use %qs.
+ * trans-intrinsic.c (gfc_conv_intrinsic_lib_function): Ditto.
+ * trans-io.c (transfer_expr): Ditto.
+ * trans-openmp.c (gfc_trans_omp_workshare): Ditto.
+ * trans.c (trans_code): Ditto.
+
2014-11-25 Tobias Burnus <burnus@net-b.de>
* gfortran.h (gfc_option_t): Remove flags moved as Var to .opt.
/* This shouldn't happen... but sometimes does. */
void
-gfc_internal_error (const char *format, ...)
+gfc_internal_error (const char *gmsgid, ...)
{
va_list argp;
+ diagnostic_info diagnostic;
- buffer_flag = 0;
-
- va_start (argp, format);
-
- show_loci (&gfc_current_locus, NULL);
- error_printf ("Internal Error at (1):");
-
- error_print ("", format, argp);
+ va_start (argp, gmsgid);
+ diagnostic_set_info (&diagnostic, gmsgid, &argp, UNKNOWN_LOCATION, DK_ICE);
+ report_diagnostic (&diagnostic);
va_end (argp);
- exit (ICE_EXIT_CODE);
+ gcc_unreachable ();
}
if (st)
return st;
}
- gfc_internal_error ("Unable to find symbol %s", sym->name);
+ gfc_internal_error ("Unable to find symbol %qs", sym->name);
/* Not reached. */
}
g = gfc_find_function (name);
if (g == NULL)
- gfc_internal_error ("make_generic(): Can't find generic symbol '%s'",
+ gfc_internal_error ("make_generic(): Can't find generic symbol %qs",
name);
gcc_assert (g->id == id);
break;
default:
- gfc_internal_error ("Invalid standard code on intrinsic '%s' (%d)",
+ gfc_internal_error ("Invalid standard code on intrinsic %qs (%d)",
isym->name, isym->standard);
}
return false;
}
- gfc_internal_error ("Can't convert %s to %s at %L",
+ gfc_internal_error ("Can't convert %qs to %qs at %L",
gfc_typename (&from_ts), gfc_typename (ts),
&expr->where);
/* Not reached */
const char *label;
if (sym->attr.flavor == FL_UNKNOWN || sym->attr.flavor == FL_LABEL)
- gfc_internal_error ("write_symbol(): bad module symbol '%s'", sym->name);
+ gfc_internal_error ("write_symbol(): bad module symbol %qs", sym->name);
mio_integer (&n);
letter = name[0];
if (gfc_option.flag_allow_leading_underscore && letter == '_')
- gfc_internal_error ("Option -fallow-leading-underscore is for use only by "
- "gfortran developers, and should not be used for "
- "implicitly typed variables");
+ gfc_fatal_error ("Option %<-fallow-leading-underscore%> is for use only by "
+ "gfortran developers, and should not be used for "
+ "implicitly typed variables");
if (letter < 'a' || letter > 'z')
- gfc_internal_error ("gfc_get_default_type(): Bad symbol '%s'", name);
+ gfc_internal_error ("gfc_get_default_type(): Bad symbol %qs", name);
if (ns == NULL)
ns = gfc_current_ns;
break;
default:
- internal_error ("bad expression type during walk (%d)",
+ gfc_internal_error ("bad expression type during walk (%d)",
expr->expr_type);
}
return ss;
}
if (sym->attr.intrinsic)
- internal_error ("intrinsic variable which isn't a procedure");
+ gfc_internal_error ("intrinsic variable which isn't a procedure");
/* Create string length decl first so that they can be used in the
type declaration. */
return;
if (sym->backend_decl && !sym->attr.vtab && !sym->attr.target)
- internal_error ("backend decl for module variable %s already exists",
- sym->name);
+ gfc_internal_error ("backend decl for module variable %qs already exists",
+ sym->name);
if (sym->module && !sym->attr.result && !sym->attr.dummy
&& (sym->attr.access == ACCESS_UNKNOWN
if (m->id == GFC_ISYM_NONE)
{
- internal_error ("Intrinsic function %s(%d) not recognized",
- expr->value.function.name, id);
+ gfc_internal_error ("Intrinsic function %qs (%d) not recognized",
+ expr->value.function.name, id);
}
/* Get the decl and generate the call. */
return;
default:
- internal_error ("Bad IO basetype (%d)", ts->type);
+ gfc_internal_error ("Bad IO basetype (%d)", ts->type);
}
tmp = gfc_build_addr_expr (NULL_TREE, dt_parm);
break;
default:
- internal_error ("gfc_trans_omp_workshare(): Bad statement code");
+ gfc_internal_error ("gfc_trans_omp_workshare(): Bad statement code");
}
gfc_set_backend_locus (&code->loc);
break;
default:
- internal_error ("gfc_trans_code(): Bad statement code");
+ gfc_internal_error ("gfc_trans_code(): Bad statement code");
}
gfc_set_backend_locus (&code->loc);