https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85084
--- Comment #2 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- I cannot reproduce this on my system. However, could you check if Index: frontend-passes.c =================================================================== --- frontend-passes.c (revision 258845) +++ frontend-passes.c (working copy) @@ -156,6 +156,10 @@ check_locus (ns); #endif + gfc_get_errors (&w, &e); + if (e > 0) + return; + if (flag_frontend_optimize || flag_frontend_loop_interchange) optimize_namespace (ns); @@ -168,10 +172,6 @@ expr_array.release (); } - gfc_get_errors (&w, &e); - if (e > 0) - return; - if (flag_realloc_lhs) realloc_strings (ns); would fix this? There is no sense in running any sort of front-end optimization if the program has errors...