diff mbox series

[fortran,committed] Clarify warning on missing location information

Message ID bdbb4aca-76a9-638f-9914-37db02f5af1a@netcologne.de
State New
Headers show
Series [fortran,committed] Clarify warning on missing location information | expand

Commit Message

Thomas Koenig Oct. 27, 2018, 10:30 a.m. UTC
Originally, the idea about checking for missing location information
when not configured for release is to catch errors when adding new
code, so forgetting to add the info will show up right away on
regression testing.

 From time to time, a user can stumble across something like that
and get a confusing error message.  This tries to make sure
people don't mistake this for their own error.

Committed as obvious, r265559. No test case because... well, this
is not supposed to happen in the first place.

Regards

	Thomas

2018-10-27  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/86907
         * frontend-passes.c (check_locus_code): Add information that
         warning about missing location information points to an
         inconsisten internal state.
         (check_locus_expr): Likewise.
diff mbox series

Patch

Index: frontend-passes.c
===================================================================
--- frontend-passes.c	(Revision 265502)
+++ frontend-passes.c	(Arbeitskopie)
@@ -190,7 +190,8 @@  check_locus_code (gfc_code **c, int *walk_subtrees
 {
   current_code = c;
   if (c && *c && (((*c)->loc.nextc == NULL) || ((*c)->loc.lb == NULL)))
-    gfc_warning_internal (0, "No location in statement");
+    gfc_warning_internal (0, "Inconsistent internal state: "
+			  "No location in statement");
 
   return 0;
 }
@@ -205,7 +206,8 @@  check_locus_expr (gfc_expr **e, int *walk_subtrees
 {
 
   if (e && *e && (((*e)->where.nextc == NULL || (*e)->where.lb == NULL)))
-    gfc_warning_internal (0, "No location in expression near %L",
+    gfc_warning_internal (0, "Inconsistent internal state: "
+			  "No location in expression near %L",
 			  &((*current_code)->loc));
   return 0;
 }