This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch installed to rtl.c to fix typo in last change
- To: ghazi at caip dot rutgers dot edu
- Subject: Re: Patch installed to rtl.c to fix typo in last change
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Sat, 24 Feb 01 07:03:54 EST
- Cc: gcc-patches at gcc dot gnu dot org
Please fix this, thanks.
Fixed, as below.
I misremembered which directory I'd set for RTL checking, but I just verified
it can indeed compile now. Sorry.
Sat Feb 24 06:45:21 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* errors.c (internal_error, trim_filename): New functions.
(fancy_abort): Call internal_error.
* errors.h (internal_error, trim_filename): New declarations.
*** errors.c 2000/07/21 07:10:36 1.4
--- errors.c 2001/02/24 11:41:59
*************** fatal VPARAMS ((const char *format, ...)
*** 106,109 ****
--- 106,160 ----
}
+ /* Similar, but say we got an internal error. */
+
+ void
+ internal_error VPARAMS ((const char *format, ...))
+ {
+ #ifndef ANSI_PROTOTYPES
+ const char *format;
+ #endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+ #ifndef ANSI_PROTOTYPES
+ format = va_arg (ap, const char *);
+ #endif
+
+ 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 if for the gen* programs and so neededn't handle subdirectories. */
+
+ const char *
+ trim_filename (name)
+ 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 && p[-1] != DIR_SEPARATOR
+ #ifdef DIR_SEPARATOR_2
+ && p[-1] != DIR_SEPARATOR_2
+ #endif
+ )
+ p--;
+
+ return p;
+ }
+
/* "Fancy" abort. Reports where in the compiler someone gave up.
This file is used only by build programs, so we're not as polite as
*************** fancy_abort (file, line, func)
*** 115,118 ****
const char *func;
{
! fatal ("ICE in %s, at %s:%d", func, file, line);
}
--- 166,169 ----
const char *func;
{
! internal_error ("abort in %s, at %s:%d", func, file, line);
}
*** errors.h 2000/08/02 17:01:11 1.5
--- errors.h 2001/02/24 11:41:59
*************** Boston, MA 02111-1307, USA. */
*** 26,34 ****
#define __GCC_ERRORS_H__
! extern void warning PARAMS ((const char *format, ...)) ATTRIBUTE_PRINTF_1;
! extern void error PARAMS ((const char *format, ...)) ATTRIBUTE_PRINTF_1;
! extern void fatal PARAMS ((const char *format, ...))
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
! extern void fancy_abort PARAMS ((const char *file, int line, const char *func))
ATTRIBUTE_NORETURN;
--- 26,37 ----
#define __GCC_ERRORS_H__
! extern void warning PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
! extern void error PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
! extern void fatal PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
! extern void internal_error PARAMS ((const char *, ...))
! ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
! extern const char *trim_filename PARAMS ((const char *));
! extern void fancy_abort PARAMS ((const char *, int, const char *))
ATTRIBUTE_NORETURN;