]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2014-11-15 Tobias Burnus <burnus@net-b.de>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 15 Nov 2014 11:06:07 +0000 (11:06 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 15 Nov 2014 11:06:07 +0000 (11:06 +0000)
gcc/fortran/
        * error.c (gfc_fatal_error_1): Renamed from gfc_fatal_error.
        (gfc_fatal_error): Add; uses common diagnostics.
        * array.c (gfc_match_array_ref, gfc_match_array_spec): Use
        %< %>.
        * check.c (check_co_collective, gfc_check_lcobound,
        gfc_check_image_index, gfc_check_num_images,
        gfc_check_this_image, gfc_check_ucobound): Ditto.
        * cpp.c (gfc_cpp_post_options): Ditto.
        (gfc_cpp_init_0, gfc_cpp_done): Change %s to %qs.
        * gfc-diagnostic.def (DK_FATAL): Capitalize first letter.
        * gfortran.h (gfc_fatal_error_1): Add.
        * match.c (gfc_match_name, gfc_match_critical,
        lock_unlock_statement, sync_statement): Add %< %>.
        * module.c (bad_module, gfc_dump_module, gfc_use_module): Change
        %s to %qs.
        * options.c (gfc_handle_module_path_options,
        * gfc_handle_fpe_option,
        gfc_handle_coarray_option, gfc_handle_runtime_check_option,
        gfc_handle_option): Add %< %>.
        * simplify.c (gfc_simplify_num_images): Ditto.
        * trans-stmt.c (gfc_trans_sync): Use gfc_fatal_error_1.
        * trans-array.c (gfc_conv_array_initializer): Ditto.
        * trans-types.c (gfc_init_kinds): Use gfc_fatal_error instead
        of fatal_error; add %< %> quotations.

gcc/testsuite/
        * gfortran.dg/binding_label_tests_4.f03: Add dg-excess-errors.
        * gfortran.dg/coarray_9.f90: Ditto.
        * gfortran.dg/empty_label.f: Ditto.
        * gfortran.dg/empty_label.f90: Ditto.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217600 138bc75d-0d04-0410-961f-82ee72b054a4

19 files changed:
gcc/fortran/ChangeLog
gcc/fortran/array.c
gcc/fortran/check.c
gcc/fortran/cpp.c
gcc/fortran/error.c
gcc/fortran/gfc-diagnostic.def
gcc/fortran/gfortran.h
gcc/fortran/match.c
gcc/fortran/module.c
gcc/fortran/options.c
gcc/fortran/simplify.c
gcc/fortran/trans-array.c
gcc/fortran/trans-stmt.c
gcc/fortran/trans-types.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/binding_label_tests_4.f03
gcc/testsuite/gfortran.dg/coarray_9.f90
gcc/testsuite/gfortran.dg/empty_label.f
gcc/testsuite/gfortran.dg/empty_label.f90

index ec1b7b5b6cf855ecd80238cedcdb79113fbb6bad..b8cf60128b74caaa9d5d8f4f8fb9aac407bdb408 100644 (file)
@@ -1,3 +1,29 @@
+2014-11-15  Tobias Burnus  <burnus@net-b.de>
+
+       * error.c (gfc_fatal_error_1): Renamed from gfc_fatal_error.
+       (gfc_fatal_error): Add; uses common diagnostics.
+       * array.c (gfc_match_array_ref, gfc_match_array_spec): Use
+       %< %>.
+       * check.c (check_co_collective, gfc_check_lcobound,
+       gfc_check_image_index, gfc_check_num_images,
+       gfc_check_this_image, gfc_check_ucobound): Ditto.
+       * cpp.c (gfc_cpp_post_options): Ditto.
+       (gfc_cpp_init_0, gfc_cpp_done): Change %s to %qs.
+       * gfc-diagnostic.def (DK_FATAL): Capitalize first letter.
+       * gfortran.h (gfc_fatal_error_1): Add.
+       * match.c (gfc_match_name, gfc_match_critical,
+       lock_unlock_statement, sync_statement): Add %< %>.
+       * module.c (bad_module, gfc_dump_module, gfc_use_module): Change
+       %s to %qs.
+       * options.c (gfc_handle_module_path_options, gfc_handle_fpe_option,
+       gfc_handle_coarray_option, gfc_handle_runtime_check_option,
+       gfc_handle_option): Add %< %>.
+       * simplify.c (gfc_simplify_num_images): Ditto.
+       * trans-stmt.c (gfc_trans_sync): Use gfc_fatal_error_1.
+       * trans-array.c (gfc_conv_array_initializer): Ditto.
+       * trans-types.c (gfc_init_kinds): Use gfc_fatal_error instead
+       of fatal_error; add %< %> quotations.
+
 2014-11-13  Bernd Schmidt  <bernds@codesourcery.com>
            Thomas Schwinge  <thomas@codesourcery.com>
            Ilya Verbin  <ilya.verbin@intel.com>
index ef2aa69f72142aba33f81c98f789f1ef0352098a..159e6263c34529edefd84e062c1e1008e8fac388 100644 (file)
@@ -209,7 +209,7 @@ coarray:
 
   if (gfc_option.coarray == GFC_FCOARRAY_NONE)
     {
-      gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
+      gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable");
       return MATCH_ERROR;
     }
 
@@ -592,7 +592,7 @@ coarray:
 
   if (gfc_option.coarray == GFC_FCOARRAY_NONE)
     {
-      gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
+      gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable");
       goto cleanup;
     }
 
index 6f1fe3fcff5da72febccb3c580fcc79bac950e82..034b329886fa2899a41c05ef1b0af40fd9346d66 100644 (file)
@@ -1482,8 +1482,8 @@ check_co_collective (gfc_expr *a, gfc_expr *image_idx, gfc_expr *stat,
 
   if (gfc_option.coarray == GFC_FCOARRAY_NONE)
     {
-      gfc_fatal_error ("Coarrays disabled at %L, use -fcoarray= to enable",
-                      &a->where);
+      gfc_fatal_error_1 ("Coarrays disabled at %L, use -fcoarray= to enable",
+                        &a->where);
       return false;
     }
 
@@ -2569,7 +2569,7 @@ gfc_check_lcobound (gfc_expr *coarray, gfc_expr *dim, gfc_expr *kind)
 {
   if (gfc_option.coarray == GFC_FCOARRAY_NONE)
     {
-      gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
+      gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable");
       return false;
     }
 
@@ -4847,7 +4847,7 @@ gfc_check_image_index (gfc_expr *coarray, gfc_expr *sub)
 
   if (gfc_option.coarray == GFC_FCOARRAY_NONE)
     {
-      gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
+      gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable");
       return false;
     }
 
@@ -4885,7 +4885,7 @@ gfc_check_num_images (gfc_expr *distance, gfc_expr *failed)
 {
   if (gfc_option.coarray == GFC_FCOARRAY_NONE)
     {
-      gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
+      gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable");
       return false;
     }
 
@@ -4927,7 +4927,7 @@ gfc_check_this_image (gfc_expr *coarray, gfc_expr *dim, gfc_expr *distance)
 {
   if (gfc_option.coarray == GFC_FCOARRAY_NONE)
     {
-      gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
+      gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable");
       return false;
     }
 
@@ -5126,7 +5126,7 @@ gfc_check_ucobound (gfc_expr *coarray, gfc_expr *dim, gfc_expr *kind)
 {
   if (gfc_option.coarray == GFC_FCOARRAY_NONE)
     {
-      gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
+      gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable");
       return false;
     }
 
index 7fb8d160267fb9f399f2550fda6d8519e5b71071..090e20974963fec6c9ca10decaf3aeb1725c1bd4 100644 (file)
@@ -450,7 +450,7 @@ gfc_cpp_post_options (void)
          || gfc_cpp_option.no_line_commands
          || gfc_cpp_option.dump_macros
          || gfc_cpp_option.dump_includes))
-    gfc_fatal_error("To enable preprocessing, use -cpp");
+    gfc_fatal_error ("To enable preprocessing, use %<-cpp%>");
 
   if (!gfc_cpp_enabled ())
     return;
@@ -548,7 +548,7 @@ gfc_cpp_init_0 (void)
 
          print.outf = fopen (gfc_cpp_option.output_filename, "w");
          if (print.outf == NULL)
-           gfc_fatal_error ("opening output file %s: %s",
+           gfc_fatal_error ("opening output file %qs: %s",
                             gfc_cpp_option.output_filename,
                             xstrerror (errno));
        }
@@ -559,7 +559,7 @@ gfc_cpp_init_0 (void)
     {
       print.outf = fopen (gfc_cpp_option.temporary_filename, "w");
       if (print.outf == NULL)
-       gfc_fatal_error ("opening output file %s: %s",
+       gfc_fatal_error ("opening output file %qs: %s",
                         gfc_cpp_option.temporary_filename, xstrerror (errno));
     }
 
@@ -666,7 +666,7 @@ gfc_cpp_done (void)
              fclose (f);
            }
          else
-           gfc_fatal_error ("opening output file %s: %s",
+           gfc_fatal_error ("opening output file %qs: %s",
                             gfc_cpp_option.deps_filename,
                             xstrerror (errno));
        }
index cbab7314ac28c92c95066a32ab87b616cdb705b2..3a508fa693e577391e28e4edb2ca12c96f214c69 100644 (file)
@@ -933,6 +933,7 @@ gfc_notify_std (int std, const char *gmsgid, ...)
 
 
 /* Immediate warning (i.e. do not buffer the warning).  */
+/* Use gfc_warning_now_2 instead, unless gmsgid contains a %L.  */
 
 void
 gfc_warning_now (const char *gmsgid, ...)
@@ -1086,6 +1087,7 @@ gfc_diagnostic_finalizer (diagnostic_context *context,
 }
 
 /* Immediate warning (i.e. do not buffer the warning).  */
+/* This function uses the common diagnostics, but does not support %L, yet.  */
 
 bool
 gfc_warning_now_2 (int opt, const char *gmsgid, ...)
@@ -1104,6 +1106,7 @@ gfc_warning_now_2 (int opt, const char *gmsgid, ...)
 }
 
 /* Immediate warning (i.e. do not buffer the warning).  */
+/* This function uses the common diagnostics, but does not support %L, yet.  */
 
 bool
 gfc_warning_now_2 (const char *gmsgid, ...)
@@ -1122,6 +1125,7 @@ gfc_warning_now_2 (const char *gmsgid, ...)
 
 
 /* Immediate error (i.e. do not buffer).  */
+/* This function uses the common diagnostics, but does not support %L, yet.  */
 
 void
 gfc_error_now_2 (const char *gmsgid, ...)
@@ -1135,6 +1139,24 @@ gfc_error_now_2 (const char *gmsgid, ...)
   va_end (argp);
 }
 
+
+/* Fatal error, never returns.  */
+/* This function uses the common diagnostics, but does not support %L, yet.  */
+
+void
+gfc_fatal_error (const char *gmsgid, ...)
+{
+  va_list argp;
+  diagnostic_info diagnostic;
+
+  va_start (argp, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &argp, UNKNOWN_LOCATION, DK_FATAL);
+  report_diagnostic (&diagnostic);
+  va_end (argp);
+
+  gcc_unreachable ();
+}
+
 /* Clear the warning flag.  */
 
 void
@@ -1213,6 +1235,7 @@ warning:
 
 
 /* Immediate error.  */
+/* Use gfc_error_now_2 instead, unless gmsgid contains a %L.  */
 
 void
 gfc_error_now (const char *gmsgid, ...)
@@ -1243,9 +1266,10 @@ gfc_error_now (const char *gmsgid, ...)
 
 
 /* Fatal error, never returns.  */
+/* Use gfc_fatal_error instead, unless gmsgid contains a %L.  */
 
 void
-gfc_fatal_error (const char *gmsgid, ...)
+gfc_fatal_error_1 (const char *gmsgid, ...)
 {
   va_list argp;
 
index 0f1044de9ca62bfdec511334241707e09c4072de..2b3caf1fef686dcc0107b0e87269c08589aef259 100644 (file)
@@ -30,7 +30,7 @@ DEFINE_DIAGNOSTIC_KIND (DK_UNSPECIFIED, "", NULL)
 DEFINE_DIAGNOSTIC_KIND (DK_IGNORED, "", NULL)
 
 /* The remainder are real diagnostic types.  */
-DEFINE_DIAGNOSTIC_KIND (DK_FATAL, "fatal error", "error")
+DEFINE_DIAGNOSTIC_KIND (DK_FATAL, "Fatal Error", "error")
 DEFINE_DIAGNOSTIC_KIND (DK_ICE, "internal compiler error", "error")
 DEFINE_DIAGNOSTIC_KIND (DK_ERROR, "Error", "error")
 DEFINE_DIAGNOSTIC_KIND (DK_SORRY, "sorry, unimplemented", "error")
index 83d2b1a7d9cba4cdbc5e542c4a326234b59e67b9..b0f15b4008047a48012d7888070675ccf03483cf 100644 (file)
@@ -2707,6 +2707,7 @@ void gfc_warning_check (void);
 void gfc_error (const char *, ...) ATTRIBUTE_GCC_GFC(1,2);
 void gfc_error_now (const char *, ...) ATTRIBUTE_GCC_GFC(1,2);
 void gfc_error_now_2 (const char *gmsgid, ...) ATTRIBUTE_GCC_GFC(1,2);
+void gfc_fatal_error_1 (const char *, ...) ATTRIBUTE_NORETURN ATTRIBUTE_GCC_GFC(1,2);
 void gfc_fatal_error (const char *, ...) ATTRIBUTE_NORETURN ATTRIBUTE_GCC_GFC(1,2);
 void gfc_internal_error (const char *, ...) ATTRIBUTE_NORETURN ATTRIBUTE_GCC_GFC(1,2);
 void gfc_clear_error (void);
index 84e2764e1312897aba85049bcd7ccf2a015f5bf6..a03b5f10d850095ad5922307d5074ff31d0f6028 100644 (file)
@@ -557,8 +557,8 @@ gfc_match_name (char *buffer)
 
   if (c == '$' && !gfc_option.flag_dollar_ok)
     {
-      gfc_fatal_error ("Invalid character '$' at %L. Use -fdollar-ok to allow "
-                      "it as an extension", &old_loc);
+      gfc_fatal_error_1 ("Invalid character '$' at %L. Use -fdollar-ok to allow"
+                        " it as an extension", &old_loc);
       return MATCH_ERROR;
     }
 
@@ -1665,7 +1665,8 @@ gfc_match_critical (void)
 
   if (gfc_option.coarray == GFC_FCOARRAY_NONE)
     {
-       gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
+       gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to "
+                       "enable");
        return MATCH_ERROR;
     }
 
@@ -2726,7 +2727,7 @@ lock_unlock_statement (gfc_statement st)
 
   if (gfc_option.coarray == GFC_FCOARRAY_NONE)
     {
-       gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
+       gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable");
        return MATCH_ERROR;
     }
 
@@ -2922,7 +2923,8 @@ sync_statement (gfc_statement st)
 
   if (gfc_option.coarray == GFC_FCOARRAY_NONE)
     {
-       gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
+       gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to "
+                       "enable");
        return MATCH_ERROR;
     }
 
index 56351f02c04c759feb3af9917ef3c56e54c83afd..b88e669c5b30eabe7cedd874055ec80d7832e0db 100644 (file)
@@ -1054,15 +1054,15 @@ bad_module (const char *msgid)
   switch (iomode)
     {
     case IO_INPUT:
-      gfc_fatal_error ("Reading module %s at line %d column %d: %s",
+      gfc_fatal_error ("Reading module %qs at line %d column %d: %s",
                       module_name, module_line, module_column, msgid);
       break;
     case IO_OUTPUT:
-      gfc_fatal_error ("Writing module %s at line %d column %d: %s",
+      gfc_fatal_error ("Writing module %qs at line %d column %d: %s",
                       module_name, module_line, module_column, msgid);
       break;
     default:
-      gfc_fatal_error ("Module %s at line %d column %d: %s",
+      gfc_fatal_error ("Module %qs at line %d column %d: %s",
                       module_name, module_line, module_column, msgid);
       break;
     }
@@ -6010,7 +6010,7 @@ gfc_dump_module (const char *name, int dump_flag)
   /* Write the module to the temporary file.  */
   module_fp = gzopen (filename_tmp, "w");
   if (module_fp == NULL)
-    gfc_fatal_error ("Can't open module file '%s' for writing at %C: %s",
+    gfc_fatal_error ("Can't open module file %qs for writing at %C: %s",
                     filename_tmp, xstrerror (errno));
 
   gzprintf (module_fp, "GFORTRAN module version '%s' created from %s\n",
@@ -6030,7 +6030,7 @@ gfc_dump_module (const char *name, int dump_flag)
   write_char ('\n');
 
   if (gzclose (module_fp))
-    gfc_fatal_error ("Error writing module file '%s' for writing: %s",
+    gfc_fatal_error ("Error writing module file %qs for writing: %s",
                     filename_tmp, xstrerror (errno));
 
   /* Read the CRC32 from the gzip trailers of the module files and
@@ -6041,10 +6041,10 @@ gfc_dump_module (const char *name, int dump_flag)
     {
       /* Module file have changed, replace the old one.  */
       if (remove (filename) && errno != ENOENT)
-       gfc_fatal_error ("Can't delete module file '%s': %s", filename,
+       gfc_fatal_error ("Can't delete module file %qs: %s", filename,
                         xstrerror (errno));
       if (rename (filename_tmp, filename))
-       gfc_fatal_error ("Can't rename module file '%s' to '%s': %s",
+       gfc_fatal_error ("Can't rename module file %qs to %qs: %s",
                         filename_tmp, filename, xstrerror (errno));
     }
   else
@@ -6789,7 +6789,7 @@ gfc_use_module (gfc_use_list *module)
       module_fp = gzopen_intrinsic_module (filename);
 
       if (module_fp == NULL && module->intrinsic)
-       gfc_fatal_error ("Can't find an intrinsic module named '%s' at %C",
+       gfc_fatal_error ("Can't find an intrinsic module named %qs at %C",
                         module_name);
 
       /* Check for the IEEE modules, so we can mark their symbols
@@ -6814,7 +6814,7 @@ gfc_use_module (gfc_use_list *module)
     }
 
   if (module_fp == NULL)
-    gfc_fatal_error ("Can't open module file '%s' for reading at %C: %s",
+    gfc_fatal_error ("Can't open module file %qs for reading at %C: %s",
                     filename, xstrerror (errno));
 
   /* Check that we haven't already USEd an intrinsic module with the
@@ -6845,7 +6845,7 @@ gfc_use_module (gfc_use_list *module)
        parse_name (c);
       if ((start == 1 && strcmp (atom_name, "GFORTRAN") != 0)
          || (start == 2 && strcmp (atom_name, " module") != 0))
-       gfc_fatal_error ("File '%s' opened at %C is not a GNU Fortran"
+       gfc_fatal_error ("File %qs opened at %C is not a GNU Fortran"
                         " module file", filename);
       if (start == 3)
        {
@@ -6853,7 +6853,7 @@ gfc_use_module (gfc_use_list *module)
              || module_char () != ' '
              || parse_atom () != ATOM_STRING
              || strcmp (atom_string, MOD_VERSION))
-           gfc_fatal_error ("Cannot read module file '%s' opened at %C,"
+           gfc_fatal_error ("Cannot read module file %qs opened at %C,"
                             " because it was created by a different"
                             " version of GNU Fortran", filename);
 
index 74b4d6d67bf7f68b977c5266375430405af17040..bbbd6abaca1092387bd8ef364dbbf5d83d8ecb8b 100644 (file)
@@ -489,7 +489,7 @@ gfc_handle_module_path_options (const char *arg)
 {
 
   if (gfc_option.module_dir != NULL)
-    gfc_fatal_error ("gfortran: Only one -J option allowed");
+    gfc_fatal_error ("gfortran: Only one %<-J%> option allowed");
 
   gfc_option.module_dir = XCNEWVEC (char, strlen (arg) + 2);
   strcpy (gfc_option.module_dir, arg);
@@ -561,9 +561,9 @@ gfc_handle_fpe_option (const char *arg, bool trap)
            }
          }
       if (!result && !trap)
-       gfc_fatal_error ("Argument to -ffpe-trap is not valid: %s", arg);
+       gfc_fatal_error ("Argument to %<-ffpe-trap%> is not valid: %s", arg);
       else if (!result)
-       gfc_fatal_error ("Argument to -ffpe-summary is not valid: %s", arg);
+       gfc_fatal_error ("Argument to %<-ffpe-summary%> is not valid: %s", arg);
 
     }
 }
@@ -579,7 +579,7 @@ gfc_handle_coarray_option (const char *arg)
   else if (strcmp (arg, "lib") == 0)
     gfc_option.coarray = GFC_FCOARRAY_LIB;
   else
-    gfc_fatal_error ("Argument to -fcoarray is not valid: %s", arg);
+    gfc_fatal_error ("Argument to %<-fcoarray%> is not valid: %s", arg);
 }
 
 
@@ -617,7 +617,7 @@ gfc_handle_runtime_check_option (const char *arg)
            }
        }
       if (!result)
-       gfc_fatal_error ("Argument to -fcheck is not valid: %s", arg);
+       gfc_fatal_error ("Argument to %<-fcheck%> is not valid: %s", arg);
     }
 }
 
@@ -823,7 +823,7 @@ gfc_handle_option (size_t scode, const char *arg, int value,
 
     case OPT_ffixed_line_length_:
       if (value != 0 && value < 7)
-       gfc_fatal_error ("Fixed line length must be at least seven.");
+       gfc_fatal_error ("Fixed line length must be at least seven");
       gfc_option.fixed_line_length = value;
       break;
 
@@ -845,7 +845,7 @@ gfc_handle_option (size_t scode, const char *arg, int value,
 
     case OPT_ffree_line_length_:
       if (value != 0 && value < 4)
-       gfc_fatal_error ("Free line length must be at least three.");
+       gfc_fatal_error ("Free line length must be at least three");
       gfc_option.free_line_length = value;
       break;
 
@@ -859,7 +859,7 @@ gfc_handle_option (size_t scode, const char *arg, int value,
 
     case OPT_static_libgfortran:
 #ifndef HAVE_LD_STATIC_DYNAMIC
-      gfc_fatal_error ("-static-libgfortran is not supported in this "
+      gfc_fatal_error ("%<-static-libgfortran%> is not supported in this "
                       "configuration");
 #endif
       break;
@@ -974,7 +974,7 @@ gfc_handle_option (size_t scode, const char *arg, int value,
       else if (!strcasecmp (arg, "true"))
        gfc_option.flag_init_logical = GFC_INIT_LOGICAL_TRUE;
       else
-       gfc_fatal_error ("Unrecognized option to -finit-logical: %s",
+       gfc_fatal_error ("Unrecognized option to %<-finit-logical%>: %s",
                         arg);
       break;
 
@@ -990,7 +990,7 @@ gfc_handle_option (size_t scode, const char *arg, int value,
       else if (!strcasecmp (arg, "-inf"))
        gfc_option.flag_init_real = GFC_INIT_REAL_NEG_INF;
       else
-       gfc_fatal_error ("Unrecognized option to -finit-real: %s",
+       gfc_fatal_error ("Unrecognized option to %<-finit-real%>: %s",
                         arg);
       break;
 
@@ -1006,7 +1006,7 @@ gfc_handle_option (size_t scode, const char *arg, int value,
          gfc_option.flag_init_character_value = (char)value;
        }
       else
-       gfc_fatal_error ("The value of n in -finit-character=n must be "
+       gfc_fatal_error ("The value of n in %<-finit-character=n%> must be "
                         "between 0 and 127");
       break;
 
index 92b72ba2d8c81944f795b199a96b36c65892beb4..3a73867ace04f97a14246a4d2157d96010a0f7e7 100644 (file)
@@ -4634,7 +4634,7 @@ gfc_simplify_num_images (gfc_expr *distance ATTRIBUTE_UNUSED, gfc_expr *failed)
 
   if (gfc_option.coarray == GFC_FCOARRAY_NONE)
     {
-      gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
+      gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable");
       return &gfc_bad_expr;
     }
 
index 9218738d2a96c4f877892a92b9288f8f65e2968b..4e5fd68383e085b09b8893f96bd637a0f005fdd9 100644 (file)
@@ -5425,11 +5425,11 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr)
             {
               /* Problems occur when we get something like
                  integer :: a(lots) = (/(i, i=1, lots)/)  */
-              gfc_fatal_error ("The number of elements in the array constructor "
-                              "at %L requires an increase of the allowed %d "
-                              "upper limit.   See -fmax-array-constructor "
-                              "option", &expr->where,
-                              gfc_option.flag_max_array_constructor);
+              gfc_fatal_error_1 ("The number of elements in the array "
+                                "constructor at %L requires an increase of "
+                                "the allowed %d upper limit. See "
+                                "-fmax-array-constructor option", &expr->where,
+                                gfc_option.flag_max_array_constructor);
              return NULL_TREE;
            }
           if (mpz_cmp_si (c->offset, 0) != 0)
index d17b0758d2c21127e55c9c1c1d4e95f79a00838d..a95809cf0dd4ac23fda8b0d833f5258eeb5556fa 100644 (file)
@@ -865,9 +865,9 @@ gfc_trans_sync (gfc_code *code, gfc_exec_op type)
        {
          /* FIXME.  */
          if (code->expr1->ts.kind != gfc_c_int_kind)
-           gfc_fatal_error ("Sorry, only support for integer kind %d "
-                            "implemented for image-set at %L",
-                            gfc_c_int_kind, &code->expr1->where);
+           gfc_fatal_error_1 ("Sorry, only support for integer kind %d "
+                              "implemented for image-set at %L",
+                              gfc_c_int_kind, &code->expr1->where);
 
          gfc_conv_array_parameter (&se, code->expr1, true, NULL, NULL, &len);
          images = se.expr;
index 060bf58ebb36eeada133c165e3518507591bbd01..12536e9a9ef0aeadb44f89ab039cb80aab8de613 100644 (file)
@@ -496,7 +496,8 @@ gfc_init_kinds (void)
   if (gfc_option.flag_default_integer)
     {
       if (!saw_i8)
-       fatal_error ("INTEGER(KIND=8) is not available for -fdefault-integer-8 option");
+       gfc_fatal_error ("INTEGER(KIND=8) is not available for "
+                        "%<-fdefault-integer-8%> option");
 
       gfc_default_integer_kind = 8;
 
@@ -504,7 +505,8 @@ gfc_init_kinds (void)
   else if (gfc_option.flag_integer4_kind == 8)
     {
       if (!saw_i8)
-       fatal_error ("INTEGER(KIND=8) is not available for -finteger-4-integer-8 option");
+       gfc_fatal_error ("INTEGER(KIND=8) is not available for "
+                        "%<-finteger-4-integer-8%> option");
 
       gfc_default_integer_kind = 8;
     }
@@ -522,28 +524,32 @@ gfc_init_kinds (void)
   if (gfc_option.flag_default_real)
     {
       if (!saw_r8)
-       fatal_error ("REAL(KIND=8) is not available for -fdefault-real-8 option");
+       gfc_fatal_error ("REAL(KIND=8) is not available for "
+                        "%<-fdefault-real-8%> option");
 
       gfc_default_real_kind = 8;
     }
   else if (gfc_option.flag_real4_kind == 8)
   {
     if (!saw_r8)
-      fatal_error ("REAL(KIND=8) is not available for -freal-4-real-8 option");
+      gfc_fatal_error ("REAL(KIND=8) is not available for %<-freal-4-real-8%> "
+                      "option");
 
     gfc_default_real_kind = 8;
   }
   else if (gfc_option.flag_real4_kind == 10)
   {
     if (!saw_r10)
-      fatal_error ("REAL(KIND=10) is not available for -freal-4-real-10 option");
+      gfc_fatal_error ("REAL(KIND=10) is not available for "
+                      "%<-freal-4-real-10%> option");
 
     gfc_default_real_kind = 10;
   }
   else if (gfc_option.flag_real4_kind == 16)
   {
     if (!saw_r16)
-      fatal_error ("REAL(KIND=16) is not available for -freal-4-real-16 option");
+      gfc_fatal_error ("REAL(KIND=16) is not available for "
+                      "%<-freal-4-real-16%> option");
 
     gfc_default_real_kind = 16;
   }
@@ -557,7 +563,8 @@ gfc_init_kinds (void)
      specified without -fdefault-double, we use kind=16, if it's available.
      Otherwise we do not change anything.  */
   if (gfc_option.flag_default_double && !gfc_option.flag_default_real)
-    fatal_error ("Use of -fdefault-double-8 requires -fdefault-real-8");
+    gfc_fatal_error ("Use of %<-fdefault-double-8%> requires "
+                    "%<-fdefault-real-8%>");
 
   if (gfc_option.flag_default_real && gfc_option.flag_default_double && saw_r8)
     gfc_default_double_kind = 8;
@@ -566,21 +573,24 @@ gfc_init_kinds (void)
   else if (gfc_option.flag_real8_kind == 4)
     {
       if (!saw_r4)
-       fatal_error ("REAL(KIND=4) is not available for -freal-8-real-4 option");
+       gfc_fatal_error ("REAL(KIND=4) is not available for "
+                        "%<-freal-8-real-4%> option");
 
        gfc_default_double_kind = 4;
     }
   else if (gfc_option.flag_real8_kind == 10 )
     {
       if (!saw_r10)
-       fatal_error ("REAL(KIND=10) is not available for -freal-8-real-10 option");
+       gfc_fatal_error ("REAL(KIND=10) is not available for "
+                        "%<-freal-8-real-10%> option");
 
        gfc_default_double_kind = 10;
     }
   else if (gfc_option.flag_real8_kind == 16 )
     {
       if (!saw_r16)
-       fatal_error ("REAL(KIND=10) is not available for -freal-8-real-16 option");
+       gfc_fatal_error ("REAL(KIND=10) is not available for "
+                        "%<-freal-8-real-16%> option");
 
        gfc_default_double_kind = 16;
     }
index 2829167e950556e1e0b45c06e39d7da05b67d9c6..33596557ba9f50768ed1364baddeff48740a07a7 100644 (file)
@@ -1,3 +1,10 @@
+2014-11-15  Tobias Burnus  <burnus@net-b.de>
+
+       * gfortran.dg/binding_label_tests_4.f03: Add dg-excess-errors.
+       * gfortran.dg/coarray_9.f90: Ditto.
+       * gfortran.dg/empty_label.f: Ditto.
+       * gfortran.dg/empty_label.f90: Ditto.
+
 2014-11-14  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        * gcc.target/powerpc/ppc-fpconv-1.c: Adjust for -mupper-regs-df
index 455726e75d0fe13b186f6ec27172252c089bd03a..69db9756f6e2a02d424e97744400e780526c6782 100644 (file)
@@ -20,5 +20,4 @@ module C
 use A
 use B ! { dg-error "Can't open module file" }
 end module C
-
-
+! { dg-excess-errors "compilation terminated" }
index cdfb4dc85a8442e1664f1729797b0566029d579c..0a4dbeccc506e5e4c5821b8ca789f4e06700fc85 100644 (file)
@@ -16,3 +16,4 @@ critical ! "Coarrays disabled"  (but error above is fatal)
 end critical ! "Expecting END PROGRAM statement"  (but error above is fatal)
 
 end
+! { dg-excess-errors "compilation terminated" }
index 446fe8b131f9cf48557051300747d7ea42f40a6c..5abf9d9f950b5177a73178c78cbc7f0f42ce7fde 100644 (file)
@@ -3,3 +3,4 @@ C { dg-options "-Werror -fmax-errors=1" }
 100   ! { dg-warning "empty statement" }
       end
 C { dg-error "count reached limit" "" { target *-*-* } 0 }
+C { dg-excess-errors "compilation terminated" }
index 6300d3079d3aad542166c6cbf1a955c535176172..d7f4a8f11948ba3f4920f15dbffae8675aad214b 100644 (file)
@@ -3,3 +3,4 @@
 100   ! { dg-warning "empty statement" }
 end
 ! { dg-error "count reached limit" "" { target *-*-* } 0 }
+! { dg-excess-errors "compilation terminated" }