aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r--gcc/fortran/module.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 6d3860e..4d664f0 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -6159,9 +6159,11 @@ create_intrinsic_function (const char *name, int id,
tmp_symtree = gfc_find_symtree (gfc_current_ns->sym_root, name);
if (tmp_symtree)
{
- if (strcmp (modname, tmp_symtree->n.sym->module) == 0)
- return;
- gfc_error ("Symbol %qs already declared", name);
+ if (tmp_symtree->n.sym && tmp_symtree->n.sym->module
+ && strcmp (modname, tmp_symtree->n.sym->module) == 0)
+ return;
+ gfc_error ("Symbol %qs at %C already declared", name);
+ return;
}
gfc_get_sym_tree (name, gfc_current_ns, &tmp_symtree, false);