This probably falls under the "obviously correct" moniker. It has been built and tested on i386-*-freebsd. OK to commit?
The patch removes a gfc_internal_error(). I suspect that it was originally put into gfortran to cover "correctly written valid Fortran code cannot possibly ever hit this line of code; so, it must be an internal error to reach this line". The code in PR 68283 is not valid Fortran. A number of error messages are spewed by gfortran prior to hitting this line of code. The patch simply removes the gfc_internal_error(), which allows gfortran to exit gracefully. 2015-11-11 Steven G. Kargl <ka...@gcc.gnu.org> PR fortran/68283 * primary.c (gfc_variable_attr): Remove a gfc_internal_error(). -- Steve
Index: gcc/fortran/primary.c =================================================================== --- gcc/fortran/primary.c (revision 229970) +++ gcc/fortran/primary.c (working copy) @@ -2268,8 +2268,6 @@ gfc_variable_attr (gfc_expr *expr, gfc_t && errors > 0) break; } - if (n == ref->u.ar.as->rank) - gfc_internal_error ("gfc_variable_attr(): Bad array reference"); } break;