Hello world, I have committed the attached patch as obvious and simple. No test case because I don't have one :-)
I am planning some more work on the PR tracking these issues, PR 78226. Regards Thomas 2016-11-06 Thomas Koenig <tkoe...@gcc.gnu.org> PR fortran/78226 resolve.c (build_loc_call): Add location to return value.
Index: resolve.c =================================================================== --- resolve.c (Revision 241747) +++ resolve.c (Arbeitskopie) @@ -8496,6 +8496,7 @@ build_loc_call (gfc_expr *sym_expr) loc_call->value.function.isym = gfc_intrinsic_function_by_id (GFC_ISYM_LOC); loc_call->value.function.actual = gfc_get_actual_arglist (); loc_call->value.function.actual->expr = sym_expr; + loc_call->where = sym_expr->where; return loc_call; }