http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55362
Tobias Burnus <burnus at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-invalid-code CC| |burnus at gcc dot gnu.org --- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-12-11 14:46:03 UTC --- Untested patch. However, I think we need to do more. I think it won't cover the DIM= argument and other intrinsics are presumably also affected. --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -3593,4 +3593,11 @@ gfc_try gfc_check_size (gfc_expr *array, gfc_expr *dim, gfc_expr *kind) { + if (array->ts.type == BT_PROCEDURE) + { + gfc_error ("'%s' argument of '%s' intrinsic at %L may not be a procedure", + gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic, + &array->where); + return FAILURE; + } if (array_check (array, 0) == FAILURE) return FAILURE;