re PR fortran/78226 (Fill out location information everywhere)
authorThomas Koenig <tkoenig@gcc.gnu.org>
Mon, 7 Nov 2016 19:33:27 +0000 (19:33 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Mon, 7 Nov 2016 19:33:27 +0000 (19:33 +0000)
2016-11-07  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/78226
* expr.c (gfc_generate_initializer):  Add where to EXPR_NULL
statement.
* iresolve.c (gfc_resolve_extends_type_of):  Add where to
both arguments of the function.
* resolve.c (resolve_select_type):  Add where to the
second argument of the new statement.

From-SVN: r241927

gcc/fortran/ChangeLog
gcc/fortran/expr.c
gcc/fortran/iresolve.c
gcc/fortran/resolve.c

index fff5058480e328118ef6f84281844e533c214fd9..535a5c15c89dc79f9083eb479b44a6dc0eb8dd85 100644 (file)
@@ -1,3 +1,13 @@
+2016-11-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/78226
+       * expr.c (gfc_generate_initializer):  Add where to EXPR_NULL
+       statement.
+       * iresolve.c (gfc_resolve_extends_type_of):  Add where to
+       both arguments of the function.
+       * resolve.c (resolve_select_type):  Add where to the
+       second argument of the new statement.
+
 2016-11-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/78226
index 0e94ae8283312468a1b14f8c9f8e9f6ae21b88f5..ba79190daf1fc97661489cdf7212d6834bcbd1c5 100644 (file)
@@ -4367,6 +4367,7 @@ gfc_generate_initializer (gfc_typespec *ts, bool generate)
        {
          ctor->expr = gfc_get_expr ();
          ctor->expr->expr_type = EXPR_NULL;
+         ctor->expr->where = init->where;
          ctor->expr->ts = comp->ts;
        }
 
index 078e47dbaa0ebad045981e9f760a6b4a84cd5bcb..b289c9f684058973c435541e7dfe2531018e9dfd 100644 (file)
@@ -1044,15 +1044,19 @@ gfc_resolve_extends_type_of (gfc_expr *f, gfc_expr *a, gfc_expr *mo)
     gfc_add_vptr_component (a);
   else if (a->ts.type == BT_DERIVED)
     {
+      locus where;
+
       vtab = gfc_find_derived_vtab (a->ts.u.derived);
       /* Clear the old expr.  */
       gfc_free_ref_list (a->ref);
+      where = a->where;
       memset (a, '\0', sizeof (gfc_expr));
       /* Construct a new one.  */
       a->expr_type = EXPR_VARIABLE;
       st = gfc_find_symtree (vtab->ns->sym_root, vtab->name);
       a->symtree = st;
       a->ts = vtab->ts;
+      a->where = where;
     }
 
   /* Replace the second argument with the corresponding vtab.  */
@@ -1060,8 +1064,11 @@ gfc_resolve_extends_type_of (gfc_expr *f, gfc_expr *a, gfc_expr *mo)
     gfc_add_vptr_component (mo);
   else if (mo->ts.type == BT_DERIVED)
     {
+      locus where;
+
       vtab = gfc_find_derived_vtab (mo->ts.u.derived);
       /* Clear the old expr.  */
+      where = mo->where;
       gfc_free_ref_list (mo->ref);
       memset (mo, '\0', sizeof (gfc_expr));
       /* Construct a new one.  */
@@ -1069,6 +1076,7 @@ gfc_resolve_extends_type_of (gfc_expr *f, gfc_expr *a, gfc_expr *mo)
       st = gfc_find_symtree (vtab->ns->sym_root, vtab->name);
       mo->symtree = st;
       mo->ts = vtab->ts;
+      mo->where = where;
     }
 
   f->ts.type = BT_LOGICAL;
index f4b1283d935f6047ce5c615e80d0fdeced462d85..3a4dd1f77e68c515d22374e027462ae7a99ed148 100644 (file)
@@ -8863,6 +8863,7 @@ resolve_select_type (gfc_code *code, gfc_namespace *old_ns)
          st = gfc_find_symtree (vtab->ns->sym_root, vtab->name);
          new_st->expr1->value.function.actual->next = gfc_get_actual_arglist ();
          new_st->expr1->value.function.actual->next->expr = gfc_get_variable_expr (st);
+         new_st->expr1->value.function.actual->next->expr->where = code->loc;
          new_st->next = body->next;
        }
        if (default_case->next)