+/* Similar, but say we got an internal error. */
+
+void
+internal_error (const char *format, ...)
+{
+ va_list ap;
+
+ va_start (ap, format);
+ fprintf (stderr, "%s: Internal error: ", progname);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
+ fputc ('\n', stderr);
+ exit (FATAL_EXIT_CODE);
+}
+
+/* Given a partial pathname as input, return another pathname that
+ shares no directory elements with the pathname of __FILE__. This
+ is used by fancy_abort() to print `Internal compiler error in expr.c'
+ instead of `Internal compiler error in ../../GCC/gcc/expr.c'. This
+ version is ment to be used for the gen* programs and therefor need not
+ handle subdirectories. */
+
+const char *
+trim_filename (const char *name)
+{
+ static const char this_file[] = __FILE__;
+ const char *p = name, *q = this_file;
+
+ /* Skip any parts the two filenames have in common. */
+ while (*p == *q && *p != 0 && *q != 0)
+ p++, q++;
+
+ /* Now go backwards until the previous directory separator. */
+ while (p > name && !IS_DIR_SEPARATOR (p[-1]))
+ p--;
+
+ return p;
+}
+