[Bug fortran/91519] [regression]ICE error in 521.wrf_r

kargl at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Aug 22 16:38:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91519

--- Comment #7 from kargl at gcc dot gnu.org ---
Thomas, this is fixed by

% svn diff gcc/fortran/frontend-passes.c 
Index: gcc/fortran/frontend-passes.c
===================================================================
--- gcc/fortran/frontend-passes.c       (revision 274676)
+++ gcc/fortran/frontend-passes.c       (working copy)
@@ -5391,7 +5391,7 @@ check_externals_expr (gfc_expr **ep, int *walk_subtree
     return 0;

   gsym = gfc_find_gsymbol (gfc_gsym_root, sym->name);
-  if (gsym == NULL)
+  if (gsym == NULL || gsym->ns == NULL)
     return 0;

   gfc_find_symbol (sym->name, gsym->ns, 0, &def_sym);


I don't know if this is correct.  The function check_externals_expr
is somewhat odd.  It is declared to return int, but all return
statements are 'return 0'.  This suggests to me that proper
declaration for this function is void.


More information about the Gcc-bugs mailing list