This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Speeding up delta by -fatal-errors


Richard Guenther wrote:
Hi!

To speed up automatically reducing testcases with delta we don't
currently have something like -fatal-errors which exit on the first
error occoured, but we rather keep going.  So would something along
the simple approach below be acceptable?  (Plus adding the -fatal-errors
switch and documentation, of course)

which would be


2004-04-06 Richard Guenther <richard.guenther@uni-tuebingen.de>

        * commom.opt (fatal-errors): Add it.
        * errors.c (flag_fatal_errors): Define it.
        (error): Check for flag_fatal_errors.
        * flags.h (flag_fatal_errors): Declare it.
        * opts.c (common_handle_option): Add OPT_fatal_errors.
        * doc/invoke.texi (Warning Options): Document -fatal-errors.
Index: gcc/common.opt
===================================================================
RCS file: /cvs/gcc/gcc/gcc/common.opt,v
retrieving revision 1.24.4.1
diff -u -c -3 -p -r1.24.4.1 common.opt
*** gcc/common.opt	18 Feb 2004 00:09:04 -0000	1.24.4.1
--- gcc/common.opt	6 Apr 2004 14:24:05 -0000
*************** fasynchronous-unwind-tables
*** 226,231 ****
--- 226,235 ----
  Common
  Generate unwind tables that are exact at each instruction boundary
  
+ fatal-errors
+ Common
+ Exit on the first error occoured
+ 
  fbounds-check
  Common
  Generate code to check bounds before indexing arrays
Index: gcc/errors.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/errors.c,v
retrieving revision 1.13
diff -u -c -3 -p -r1.13 errors.c
*** gcc/errors.c	7 Oct 2003 20:06:37 -0000	1.13
--- gcc/errors.c	6 Apr 2004 14:24:05 -0000
*************** const char *progname;
*** 35,40 ****
--- 35,42 ----
  
  int have_error = 0;
  
+ int flag_fatal_errors = 0;
+ 
  /* Print a warning message - output produced, but there may be problems.  */
  
  void
*************** error (const char *format, ...)
*** 63,68 ****
--- 65,72 ----
    va_end (ap);
    fputc('\n', stderr);
  
+   if (flag_fatal_errors)
+     exit (FATAL_EXIT_CODE);
    have_error = 1;
  }
  
Index: gcc/flags.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flags.h,v
retrieving revision 1.127.4.1
diff -u -c -3 -p -r1.127.4.1 flags.h
*** gcc/flags.h	18 Feb 2004 00:09:04 -0000	1.127.4.1
--- gcc/flags.h	6 Apr 2004 14:24:06 -0000
*************** extern int flag_really_no_inline;
*** 406,411 ****
--- 406,415 ----
  
  extern int flag_syntax_only;
  
+ /* Nonzero if we are exiting on the first error occoured.  */
+ 
+ extern int flag_fatal_errors;
+ 
  /* Nonzero means we should save auxiliary info into a .X file.  */
  
  extern int flag_gen_aux_info;
Index: gcc/opts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/opts.c,v
retrieving revision 1.51.4.3
diff -u -c -3 -p -r1.51.4.3 opts.c
*** gcc/opts.c	18 Feb 2004 00:09:04 -0000	1.51.4.3
--- gcc/opts.c	6 Apr 2004 14:24:06 -0000
*************** common_handle_option (size_t scode, cons
*** 885,890 ****
--- 885,894 ----
        flag_asynchronous_unwind_tables = value;
        break;
  
+     case OPT_fatal_errors:
+       flag_fatal_errors = value;
+       break;
+ 
      case OPT_fbounds_check:
        flag_bounds_check = value;
        break;
Index: gcc/doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.390.2.22
diff -u -c -3 -p -r1.390.2.22 invoke.texi
*** gcc/doc/invoke.texi	15 Mar 2004 21:15:33 -0000	1.390.2.22
--- gcc/doc/invoke.texi	6 Apr 2004 14:24:15 -0000
*************** in the following sections.
*** 209,215 ****
  
  @item Warning Options
  @xref{Warning Options,,Options to Request or Suppress Warnings}.
! @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
  -w  -Wextra  -Wall  -Waggregate-return @gol
  -Wcast-align  -Wcast-qual  -Wchar-subscripts  -Wcomment @gol
  -Wconversion  -Wno-deprecated-declarations @gol
--- 209,215 ----
  
  @item Warning Options
  @xref{Warning Options,,Options to Request or Suppress Warnings}.
! @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors -fatal-errors @gol
  -w  -Wextra  -Wall  -Waggregate-return @gol
  -Wcast-align  -Wcast-qual  -Wchar-subscripts  -Wcomment @gol
  -Wconversion  -Wno-deprecated-declarations @gol
*************** nothing to warn about.)
*** 2055,2060 ****
--- 2055,2066 ----
  @opindex pedantic-errors
  Like @option{-pedantic}, except that errors are produced rather than
  warnings.
+ 
+ @item -fatal-errors
+ @opindex fatal-errors
+ This option causes the compiler to abort compilation on the first error
+ occoured rather than trying to keep going and printing further error
+ messages.
  
  @item -w
  @opindex w

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]