aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-01-30 16:15:00 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2015-01-30 16:15:00 +0000
commit40fecdd62f7d293a214dd71b81de5e0f1099bba7 (patch)
tree205b68f7ca81a40e0ec33999911c7cd124be49b1 /gcc/fortran
parent4811c44ee01bba9fd09fe5e2b6b9fc9be66b33c9 (diff)
downloadgcc-40fecdd62f7d293a214dd71b81de5e0f1099bba7.zip
gcc-40fecdd62f7d293a214dd71b81de5e0f1099bba7.tar.gz
gcc-40fecdd62f7d293a214dd71b81de5e0f1099bba7.tar.bz2
Always pass explicit location to fatal_error.
The patch <https://gcc.gnu.org/ml/gcc-patches/2014-11/msg00698.html> adding an overload for fatal_error that passes an explicit location broke gcc.pot regeneration because xgettext cannot handle function overloads with the diagnostic string argument in different positions. As the desired direction is for all diagnostics to have explicit locations, this patch addresses the regression by removing the version of fatal_error that does not pass a location, passing explicit input_location everywhere (in the hope that those will incrementally be changed to other locations, much as with the addition of a location argument to pedwarn some time ago - a lot of cases aren't meaningfully associated with a source file so UNKNOWN_LOCATION may be better). Note that this patch does not attempt to fix any existing issues with these diagnostics (such as wrongly starting with capital letters or ending with '.' or '\n'); it just adds the input_location argument. Bootstrapped with no regressions for x86_64-unknown-linux-gnu (Go excluded). gcc: * diagnostic.c (fatal_error (const char *, ...)): Remove function. * diagnostic-core.h (fatal_error (const char *, ...)): Remove prototype. * toplev.h (init_asm_output): Update comment on use of UNKNOWN_LOCATION with fatal_error. * cgraph.c, collect-utils.c, collect2.c, config/arc/arc.c, config/arc/arc.md, config/avr/avr.c, config/c6x/c6x.h, config/darwin.c, config/host-darwin.c, config/i386/host-cygwin.c, config/i386/intelmic-mkoffload.c, config/nios2/nios2.c, config/nvptx/mkoffload.c, config/nvptx/nvptx.h, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, gcc.c, gcov-io.h, gcov-tool.c, ggc-common.c, ggc-page.c, graph.c, ipa-inline-analysis.c, ipa-reference.c, lto-cgraph.c, lto-section-in.c, lto-streamer-in.c, lto-streamer.c, lto-wrapper.c, objc/objc-act.c, opts.c, passes.c, plugin.c, tlink.c, toplev.c, tree-streamer-in.c, varpool.c: All callers of fatal_error changed to pass input_location as first argument. gcc/c-family: * c-opts.c, c-pch.c, cppspec.c: All callers of fatal_error changed to pass input_location as first argument. gcc/cp: * class.c, except.c, parser.c, pt.c: All callers of fatal_error changed to pass input_location as first argument. gcc/fortran: * f95-lang.c, gfortranspec.c, trans-const.c, trans-expr.c: All callers of fatal_error changed to pass input_location as first argument. gcc/java: * class.c, expr.c, jcf-parse.c, jvspec.c: All callers of fatal_error changed to pass input_location as first argument. gcc/lto: * lto-object.c, lto-symtab.c, lto.c: All callers of fatal_error changed to pass input_location as first argument. libcc1: * plugin.cc: All callers of fatal_error changed to pass input_location as first argument. From-SVN: r220293
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/f95-lang.c2
-rw-r--r--gcc/fortran/gfortranspec.c5
-rw-r--r--gcc/fortran/trans-const.c3
-rw-r--r--gcc/fortran/trans-expr.c2
5 files changed, 13 insertions, 5 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index c86b1a2..01462d2 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2015-01-30 Joseph Myers <joseph@codesourcery.com>
+
+ * f95-lang.c, gfortranspec.c, trans-const.c, trans-expr.c: All
+ callers of fatal_error changed to pass input_location as first
+ argument.
+
2015-01-28 Tobias Burnus <burnus@net-b.de>
* intrinsic.texi (CO_BROADCAST): Correct argument description.
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index 449f01a..94f7479 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -265,7 +265,7 @@ gfc_init (void)
gfc_init_1 ();
if (!gfc_new_file ())
- fatal_error ("can't open input file: %s", gfc_source_file);
+ fatal_error (input_location, "can't open input file: %s", gfc_source_file);
if (flag_preprocess_only)
return false;
diff --git a/gcc/fortran/gfortranspec.c b/gcc/fortran/gfortranspec.c
index a5b3310..8af4c76 100644
--- a/gcc/fortran/gfortranspec.c
+++ b/gcc/fortran/gfortranspec.c
@@ -142,7 +142,7 @@ append_arg (const struct cl_decoded_option *arg)
}
if (g77_newargc == newargsize)
- fatal_error ("overflowed output arg list for %qs",
+ fatal_error (input_location, "overflowed output arg list for %qs",
arg->orig_option_with_args_text);
g77_new_decoded_options[g77_newargc++] = *arg;
@@ -296,7 +296,8 @@ For more information about these matters, see the file named COPYING\n\n"));
}
if ((n_outfiles != 0) && (n_infiles == 0))
- fatal_error ("no input files; unwilling to write output files");
+ fatal_error (input_location,
+ "no input files; unwilling to write output files");
/* If there are no input files, no need for the library. */
if (n_infiles == 0)
diff --git a/gcc/fortran/trans-const.c b/gcc/fortran/trans-const.c
index 4e2f577..eb447a5 100644
--- a/gcc/fortran/trans-const.c
+++ b/gcc/fortran/trans-const.c
@@ -368,7 +368,8 @@ gfc_conv_constant_to_tree (gfc_expr * expr)
expr->representation.string);
default:
- fatal_error ("gfc_conv_constant_to_tree(): invalid type: %s",
+ fatal_error (input_location,
+ "gfc_conv_constant_to_tree(): invalid type: %s",
gfc_typename (&expr->ts));
}
}
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 91cac41..70da287 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -2859,7 +2859,7 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr)
gcc_unreachable ();
default:
- fatal_error ("Unknown intrinsic op");
+ fatal_error (input_location, "Unknown intrinsic op");
return;
}