diff options
-rw-r--r-- | gcc/ChangeLog | 29 | ||||
-rw-r--r-- | gcc/Makefile.in | 27 | ||||
-rw-r--r-- | gcc/collect2.c | 4 | ||||
-rw-r--r-- | gcc/collect2.h | 1 | ||||
-rw-r--r-- | gcc/errors.c | 6 | ||||
-rw-r--r-- | gcc/errors.h | 2 | ||||
-rw-r--r-- | gcc/fix-header.c | 28 | ||||
-rw-r--r-- | gcc/fixinc/Makefile.in | 2 | ||||
-rw-r--r-- | gcc/gcc.c | 4 | ||||
-rw-r--r-- | gcc/gcc.h | 1 | ||||
-rw-r--r-- | gcc/gcov.c | 11 | ||||
-rw-r--r-- | gcc/java/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/java/jv-scan.c | 6 | ||||
-rw-r--r-- | gcc/rtl.h | 10 | ||||
-rw-r--r-- | gcc/system.h | 5 | ||||
-rw-r--r-- | gcc/tree.h | 10 |
16 files changed, 70 insertions, 82 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a673be7..a9aee48 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,32 @@ 2004-08-23 Nathan Sidwell <nathan@codesourcery.com> + * Makefile.in (BUILD_ERRORS): Set to build-errors. + (errors.o): New target for host. + (build-errors.o): New target for build. + (genobjs): Replace errors.o with build-errors. + (gengenrtl$(buildexeext)): Add $(BUILD_ERRORS). + (GCOV_OBJS, GCOV_DUMP_OBJS): Add errors.o. + (fix-headers$(build_exeext)): Add $(BUILD_ERRORS). + (fix-header.o): Add errors.h + * collect2.c (fancy_abort): Add parameters. + * collect2.h (fancy_abort): Don't declare. + * errors.h (fancy_abort): Don't declare. + * errors.c: Include either bconfig.h or config.h. + (fancy_abort): Trim filename. + * fix-header.c (v_fatal, fatal): Remove. + (progname): Remove definition. + (main): Set progname here. + * gcc.c (fancy_abort): Add parameters. + * gcc.h (fancy_abort): Remove declaration. + * gcov.c (fancy_abort): Remove. + * rtl.h (fancy_abort): Don't declare. + (abort): Don't define. + * tree.h (fancy_abort): Don't declare. + (abort): Don't define. + * system.h (fancy_abort): Declare. + (abort): Define to fancy_abort. + * fixinc/Makefile.in (ALLOBJ): Add ../build-errors.o + * tree.h (enum size_type_kind): Remove USIZETYPE, UBITSIZETYPE. (usize_type, ubitsizetype): Remove. * stor-layout.c (set_sizetype): Don't initialize usizetype, @@ -3223,7 +3250,7 @@ * config/i386/xmmintrin.h: Include <mm_malloc.h>. 2004-08-03 H.J. Lu <hongjiu.lu@intel.com> - Tanguy Fautrà <tfautre@pandora.be> + Tanguy Fautrà <tfautre@pandora.be> * config/i386/pmm_malloc.h: New file. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index a71558b..14de81e 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -771,7 +771,7 @@ BUILD_SUPPORT = gensupport.o insn-conditions.o BUILD_EARLY_SUPPORT = gensupport.o dummy-conditions.o BUILD_PRINT = build-print-rtl.o -BUILD_ERRORS = errors.o +BUILD_ERRORS = build-errors.o BUILD_VARRAY = build-varray.o # Specify the directories to be searched for header files. @@ -2137,6 +2137,7 @@ lambda-mat.o : lambda-mat.c lambda.h $(GGC_H) $(SYSTEM_H) $(CONFIG_H) $(TM_H) params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(PARAMS_H) toplev.h hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(HOOKS_H) pretty-print.o: $(CONFIG_H) $(SYSTEM_H) pretty-print.c $(PRETTY_PRINT_H) +errors.o : errors.c $(CONFIG_H) $(SYSTEM_H) errors.h $(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) $(GGC_H) \ $(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \ @@ -2464,8 +2465,9 @@ genprogs=$(genprognames:%=%$(build_exeext)) genobjs=$(genprognames:%=%.o) read-rtl.o gensupport.o genattrtab.o \ genautomata.o gengenrtl.o genmodes.o genpreds.o gengtype.o \ genconstants.o gen-protos.o scan.o fix-header.o scan-decls.o \ - gencheck.o dummy-conditions.o genconditions.o errors.o ggc-none.o \ - min-insn-modes.o build-rtl.o build-print-rtl.o build-varray.o + gencheck.o dummy-conditions.o genconditions.o build-errors.o \ + ggc-none.o min-insn-modes.o build-rtl.o build-print-rtl.o \ + build-varray.o $(genprogs): %$(build_exeext): %.o $(BUILD_RTL) $(BUILD_SUPPORT) \ $(BUILD_PRINT) $(BUILD_ERRORS) \ @@ -2537,9 +2539,9 @@ genautomata.o : genautomata.c $(RTL_BASE_H) $(OBSTACK_H) $(BCONFIG_H) \ genoutput.o : genoutput.c $(RTL_BASE_H) $(BCONFIG_H) \ $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h -gengenrtl$(build_exeext) : gengenrtl.o $(BUILD_LIBDEPS) +gengenrtl$(build_exeext) : gengenrtl.o $(BUILD_ERRORS) $(BUILD_LIBDEPS) $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \ - gengenrtl.o $(BUILD_LIBS) + gengenrtl.o $(BUILD_ERRORS) $(BUILD_LIBS) gengenrtl.o : gengenrtl.c $(BCONFIG_H) $(SYSTEM_H) rtl.def @@ -2592,7 +2594,7 @@ genconditions$(build_exeext) : genconditions.o $(BUILD_EARLY_SUPPORT) \ genconditions.o : genconditions.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ coretypes.h $(GTM_H) errors.h -errors.o : errors.c $(BCONFIG_H) $(SYSTEM_H) errors.h +build-errors.o : errors.c $(BCONFIG_H) $(SYSTEM_H) errors.h ggc-none.o : ggc-none.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) min-insn-modes.o : min-insn-modes.c $(BCONFIG_H) system.h $(MACHMODE_H) build-rtl.o: rtl.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) $(RTL_H) \ @@ -2711,12 +2713,10 @@ s-iov: gcov-iov$(build_exeext) gcov.o: gcov.c gcov-io.h gcov-io.c gcov-iov.h intl.h $(SYSTEM_H) coretypes.h $(TM_H) $(CONFIG_H) gcov-dump.o: gcov-dump.c gcov-io.h gcov-io.c gcov-iov.h $(SYSTEM_H) coretypes.h $(TM_H) $(CONFIG_H) -# Only one of 'gcov' or 'gcov.exe' is actually built, depending -# upon whether $(exeext) is empty or not. -GCOV_OBJS = gcov.o intl.o version.o +GCOV_OBJS = gcov.o intl.o version.o errors.o gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@ -GCOV_DUMP_OBJS = gcov-dump.o version.o +GCOV_DUMP_OBJS = gcov-dump.o version.o errors.o gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) $(LIBS) -o $@ # @@ -2841,11 +2841,12 @@ xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos$(build_ # This is nominally a 'build' program, but it's run only when host==build, # so we can (indeed, must) use $(LIBDEPS) and $(LIBS). fix-header$(build_exeext): fix-header.o scan-decls.o scan.o xsys-protos.h \ - c-incpath.o cppdefault.o prefix.o $(LIBDEPS) + c-incpath.o cppdefault.o prefix.o $(BUILD_ERRORS) $(LIBDEPS) $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ fix-header.o \ - c-incpath.o cppdefault.o scan-decls.o prefix.o scan.o $(LIBS) + c-incpath.o cppdefault.o scan-decls.o prefix.o scan.o \ + $(BUILD_ERRORS) $(LIBS) -fix-header.o: fix-header.c $(OBSTACK_H) scan.h \ +fix-header.o: fix-header.c $(OBSTACK_H) scan.h errors.h \ xsys-protos.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(CPPLIB_H) scan-decls.o: scan-decls.c scan.h $(CPPLIB_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) diff --git a/gcc/collect2.c b/gcc/collect2.c index 2edbea8..0b398f7 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -401,9 +401,9 @@ error (const char * msgid, ...) provide a default entry. */ void -fancy_abort (void) +fancy_abort (const char *file, int line, const char *func) { - fatal ("internal error"); + fatal ("internal gcc abort in %s, at %s:%d", func, file, line); } static void diff --git a/gcc/collect2.h b/gcc/collect2.h index 2434f16..710e19a 100644 --- a/gcc/collect2.h +++ b/gcc/collect2.h @@ -39,7 +39,6 @@ extern struct obstack temporary_obstack; extern char *temporary_firstobj; extern int vflag, debug; -extern void fancy_abort (void) ATTRIBUTE_NORETURN; extern void error (const char *, ...) ATTRIBUTE_PRINTF_1; extern void notice (const char *, ...) ATTRIBUTE_PRINTF_1; extern void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; diff --git a/gcc/errors.c b/gcc/errors.c index 13288a8..6889c73 100644 --- a/gcc/errors.c +++ b/gcc/errors.c @@ -23,7 +23,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA in the generator programs; the compiler has a more elaborate suite of diagnostic printers, found in diagnostic.c. */ +#ifdef GENERATOR_FILE #include "bconfig.h" +#else +#include "config.h" +#endif #include "system.h" #include "errors.h" @@ -126,5 +130,5 @@ trim_filename (const char *name) void fancy_abort (const char *file, int line, const char *func) { - internal_error ("abort in %s, at %s:%d", func, file, line); + internal_error ("abort in %s, at %s:%d", func, trim_filename (file), line); } diff --git a/gcc/errors.h b/gcc/errors.h index 9e0bf1e..df5d8d8 100644 --- a/gcc/errors.h +++ b/gcc/errors.h @@ -35,8 +35,6 @@ extern void error (const char *, ...); extern void fatal (const char *, ...) ATTRIBUTE_NORETURN; extern void internal_error (const char *, ...) ATTRIBUTE_NORETURN; extern const char *trim_filename (const char *); -extern void fancy_abort (const char *, int, const char *) - ATTRIBUTE_NORETURN; extern int have_error; extern const char *progname; diff --git a/gcc/fix-header.c b/gcc/fix-header.c index 5e2e7bb..0212cf7 100644 --- a/gcc/fix-header.c +++ b/gcc/fix-header.c @@ -79,10 +79,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "scan.h" #include "cpplib.h" #include "c-incpath.h" - -static void v_fatal (const char *, va_list) - ATTRIBUTE_PRINTF (1,0) ATTRIBUTE_NORETURN; -static void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; +#include "errors.h" #ifdef TARGET_EXTRA_INCLUDES static void hook_void_int(int u ATTRIBUTE_UNUSED) { } @@ -407,7 +404,6 @@ lookup_std_proto (const char *name, int name_length) char *inc_filename; int inc_filename_length; -const char *progname = "fix-header"; FILE *outf; sstring line; @@ -1076,6 +1072,7 @@ main (int argc, char **argv) long int inf_size; struct symbol_list *cur_symbols; + progname = "fix-header"; if (argv[0] && argv[0][0]) { char *p; @@ -1301,24 +1298,3 @@ main (int argc, char **argv) return 0; } - - -static void -v_fatal (const char *str, va_list ap) -{ - fprintf (stderr, "%s: %s: ", progname, inc_filename); - vfprintf (stderr, str, ap); - fprintf (stderr, "\n"); - - exit (FATAL_EXIT_CODE); -} - -static void -fatal (const char *str, ...) -{ - va_list ap; - - va_start (ap, str); - v_fatal (str, ap); - va_end (ap); -} diff --git a/gcc/fixinc/Makefile.in b/gcc/fixinc/Makefile.in index 22ea44f..ae410e1 100644 --- a/gcc/fixinc/Makefile.in +++ b/gcc/fixinc/Makefile.in @@ -68,7 +68,7 @@ INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. \ LIBERTY = ../../libiberty/libiberty.a ALLOBJ = fixincl.o fixtests.o fixfixes.o server.o procopen.o \ - fixlib.o + fixlib.o ../build-errors.o TESTOBJ = fixincl.o fixlib.o fixtests.o FIXOBJ = fixfixes.o fixlib.o @@ -6724,9 +6724,9 @@ pfatal_pexecute (const char *errmsg_fmt, const char *errmsg_arg) /* Output an error message and exit. */ void -fancy_abort (void) +fancy_abort (const char *file, int line, const char *func) { - fatal ("internal gcc abort"); + fatal ("internal gcc abort in %s, at %s:%d", func, file, line); } /* Output an error message and exit. */ @@ -56,7 +56,6 @@ struct spec_function /* These are exported by gcc.c. */ extern int do_spec (const char *); extern void record_temp_file (const char *, int, int); -extern void fancy_abort (void) ATTRIBUTE_NORETURN; extern void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; extern void error (const char *, ...) ATTRIBUTE_PRINTF_1; extern void pfatal_with_name (const char *) ATTRIBUTE_NORETURN; @@ -373,17 +373,6 @@ fnotice (FILE *file, const char *msgid, ...) vfprintf (file, _(msgid), ap); va_end (ap); } - -/* More 'friendly' abort that prints the line and file. - config.h can #define abort fancy_abort if you like that sort of thing. */ -extern void fancy_abort (void) ATTRIBUTE_NORETURN; - -void -fancy_abort (void) -{ - fnotice (stderr, "Internal gcov abort.\n"); - exit (FATAL_EXIT_CODE); -} /* Print a usage message and exit. If ERROR_P is nonzero, this is an error, otherwise the output of --help. */ diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 5af0be7..0e7bb8b 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +2004-08-23 Nathan Sidwell <nathan@codesourcery.com> + + * jv-scan.c (fancy_abort): Add. + 2004-08-20 Nathan Sidwell <nathan@codesourcery.com> * expr.c (build_java_arrayaccess): Use convert to change @@ -8592,7 +8596,7 @@ properly initialize `finished_label'. Don't emit gotos for empty try statements. -2000-03-19 Martin v. Löwis <loewis@informatik.hu-berlin.de> +2000-03-19 Martin v. Löwis <loewis@informatik.hu-berlin.de> * except.c (emit_handlers): Clear catch_clauses_last. diff --git a/gcc/java/jv-scan.c b/gcc/java/jv-scan.c index 1e9490b..77320e6 100644 --- a/gcc/java/jv-scan.c +++ b/gcc/java/jv-scan.c @@ -261,3 +261,9 @@ warning (const char *msgid, ...) fputc ('\n', stderr); va_end (ap); } + +void +fancy_abort (const char *file, int line, const char *func) +{ + fatal_error ("abort in %s, at %s:%d", func, file, line); +} @@ -2151,16 +2151,6 @@ extern rtx read_rtx (FILE *); extern const char *read_rtx_filename; extern int read_rtx_lineno; -/* Redefine abort to report an internal error w/o coredump, and - reporting the location of the error in the source file. This logic - is duplicated in rtl.h and tree.h because every file that needs the - special abort includes one or both. toplev.h gets too few files, - system.h gets too many. */ - -extern void fancy_abort (const char *, int, const char *) - ATTRIBUTE_NORETURN; -#define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__) - /* In alias.c */ extern void clear_reg_alias_info (rtx); extern rtx canon_rtx (rtx); diff --git a/gcc/system.h b/gcc/system.h index 3411fc4..ccb3d4b 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -500,6 +500,11 @@ extern int snprintf (char *, size_t, const char *, ...); #define __builtin_expect(a, b) (a) #endif +/* Redefine abort to report an internal error w/o coredump, and + reporting the location of the error in the source file. */ +extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; +#define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__) + /* Provide a fake boolean type. We make no attempt to use the C99 _Bool, as it may not be available in the bootstrap compiler, and even if it is, it is liable to be buggy. @@ -3746,16 +3746,6 @@ extern const char *dump_flag_name (enum tree_dump_index); extern void set_decl_rtl (tree, rtx); extern void set_decl_incoming_rtl (tree, rtx); -/* Redefine abort to report an internal error w/o coredump, and - reporting the location of the error in the source file. This logic - is duplicated in rtl.h and tree.h because every file that needs the - special abort includes one or both. toplev.h gets too few files, - system.h gets too many. */ - -extern void fancy_abort (const char *, int, const char *) - ATTRIBUTE_NORETURN; -#define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__) - /* Enum and arrays used for tree allocation stats. Keep in sync with tree.c:tree_node_kind_names. */ typedef enum |