This just avoids a crash with -fdump-fortran-global when the
global symbol table is empty. This is strictly a developer's
option, no user impact.
gcc/fortran/ChangeLog:
2020-06-14 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/42122
* dump-parse-tree.c (gfc_dump_global_symbols): If the symroot is
empty, just output "empty".
void
gfc_dump_global_symbols (FILE *f)
{
- gfc_traverse_gsymbol (gfc_gsym_root, show_global_symbol, (void *) f);
+ if (gfc_gsym_root == NULL)
+ fprintf (f, "empty\n");
+ else
+ gfc_traverse_gsymbol (gfc_gsym_root, show_global_symbol, (void *) f);
}