https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71883
--- Comment #10 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- Not quite as radical, but could also help avoid quite a few errors in front-end optimization: ndex: frontend-passes.c =================================================================== --- frontend-passes.c (Revision 238638) +++ frontend-passes.c (Arbeitskopie) @@ -119,6 +119,7 @@ void gfc_run_passes (gfc_namespace *ns) { + int w, e; /* Warn about dubious DO loops where the index might change. */ @@ -136,6 +137,10 @@ gfc_run_passes (gfc_namespace *ns) expr_array.release (); } + gfc_get_errors (&w, &e); + if (e >0) + return; + if (flag_realloc_lhs) realloc_strings (ns); }