https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54262
--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- > So far I did not find what to change to make specific->inquiry true for LOC. Fixed by the following patch --- ../_clean/gcc/fortran/intrinsic.c 2019-03-12 16:12:35.000000000 +0100 +++ gcc/fortran/intrinsic.c 2019-03-21 11:24:16.000000000 +0100 @@ -212,7 +212,8 @@ do_ts29113_check (gfc_intrinsic_sym *spe && specific->id != GFC_ISYM_SIZEOF && specific->id != GFC_ISYM_UBOUND && specific->id != GFC_ISYM_IS_CONTIGUOUS - && specific->id != GFC_ISYM_C_LOC) + && specific->id != GFC_ISYM_C_LOC + && specific->id != GFC_ISYM_LOC) { gfc_error ("Assumed-type argument at %L is not permitted as actual" " argument to the intrinsic %s", &a->expr->where, @@ -3234,7 +3235,7 @@ add_functions (void) make_generic ("verify", GFC_ISYM_VERIFY, GFC_STD_F95); - add_sym_1 ("loc", GFC_ISYM_LOC, CLASS_IMPURE, ACTUAL_NO, BT_INTEGER, ii, + add_sym_1 ("loc", GFC_ISYM_LOC, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER, ii, GFC_STD_GNU, gfc_check_loc, NULL, gfc_resolve_loc, x, BT_UNKNOWN, 0, REQUIRED);