https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71883
--- Comment #8 from kargl at gcc dot gnu.org --- (In reply to paul.richard.tho...@gmail.com from comment #6) > Hi Steve, > > Thanks, you beat me to it! > > Cheers > > Paul > > PS Since I caused this regression, perhaps I should take it on :-) > ; > > + { > > + int e, w; > > + gfc_get_errors (&w, &e); > > + if (e < 1) > > + gfc_internal_error ("gfc_is_constant_expr(): Unknown " > > + "expression type"); > > + return 0; > > + } > > } I'm tempted to suggest that gfc_internal_error() should be modified to check for a nonzero error count. If gfortran has already issued one or more errors, then gfc_internal_error should simply exit; otherwise, issue the error. Something like Index: error.c =================================================================== --- error.c (revision 238385) +++ error.c (working copy) @@ -1303,10 +1303,15 @@ gfc_error (const char *gmsgid, ...) void gfc_internal_error (const char *gmsgid, ...) { + int e, w; va_list argp; diagnostic_info diagnostic; rich_location rich_loc (line_table, UNKNOWN_LOCATION); + gfc_get_errors (&w, &e); + if (e > 0) + exit(EXIT_FAILURE); + va_start (argp, gmsgid); diagnostic_set_info (&diagnostic, gmsgid, &argp, &rich_loc, DK_ICE); report_diagnostic (&diagnostic);