aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorMikael Morin <mikael@gcc.gnu.org>2015-04-10 11:29:53 +0000
committerMikael Morin <mikael@gcc.gnu.org>2015-04-10 11:29:53 +0000
commit44c57c2f9049c9fa53817b71110cf0cee00675b6 (patch)
treeb5b49b95711b85f24d871a5d6f80a3a141d8a305 /gcc/fortran
parentc3d71b62c66f81b95213b88897cdd75f840e2fae (diff)
downloadgcc-44c57c2f9049c9fa53817b71110cf0cee00675b6.zip
gcc-44c57c2f9049c9fa53817b71110cf0cee00675b6.tar.gz
gcc-44c57c2f9049c9fa53817b71110cf0cee00675b6.tar.bz2
re PR fortran/56674 (ICE in check_sym_interfaces)
PR fortran/56674 PR fortran/58813 PR fortran/59016 PR fortran/59024 fortran/ * symbol.c (save_symbol_data, gfc_save_symbol_data): Rename the former to the latter and make it non-static. Update callers. * gfortran.h (gfc_save_symbol_data): New prototype. * decl.c (gfc_match_decl_type_spec): Call 'gfc_save_symbol_data' before modifying symbols 'sym' and 'dt_sym'. testsuite/ * gfortran.dg/used_types_27.f90: New. From-SVN: r221972
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog12
-rw-r--r--gcc/fortran/decl.c3
-rw-r--r--gcc/fortran/gfortran.h1
-rw-r--r--gcc/fortran/symbol.c8
4 files changed, 20 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 78305a0..d3fa359 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,15 @@
+2015-04-10 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/56674
+ PR fortran/58813
+ PR fortran/59016
+ PR fortran/59024
+ * symbol.c (save_symbol_data, gfc_save_symbol_data): Rename the
+ former to the latter and make it non-static. Update callers.
+ * gfortran.h (gfc_save_symbol_data): New prototype.
+ * decl.c (gfc_match_decl_type_spec): Call 'gfc_save_symbol_data'
+ before modifying symbols 'sym' and 'dt_sym'.
+
2013-04-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/56852
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 40d851c..037a8cc 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -2876,6 +2876,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
return MATCH_ERROR;
}
+ gfc_save_symbol_data (sym);
gfc_set_sym_referenced (sym);
if (!sym->attr.generic
&& !gfc_add_generic (&sym->attr, sym->name, NULL))
@@ -2900,6 +2901,8 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
sym->generic = intr;
sym->attr.if_source = IFSRC_DECL;
}
+ else
+ gfc_save_symbol_data (dt_sym);
gfc_set_sym_referenced (dt_sym);
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 24d56c0..9d09de6 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -2819,6 +2819,7 @@ bool verify_bind_c_derived_type (gfc_symbol *);
bool verify_com_block_vars_c_interop (gfc_common_head *);
gfc_symtree *generate_isocbinding_symbol (const char *, iso_c_binding_symbol,
const char *, gfc_symtree *, bool);
+void gfc_save_symbol_data (gfc_symbol *);
int gfc_get_sym_tree (const char *, gfc_namespace *, gfc_symtree **, bool);
int gfc_get_ha_symbol (const char *, gfc_symbol **);
int gfc_get_ha_sym_tree (const char *, gfc_symtree **);
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 32eea21..44392e8 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -2758,8 +2758,8 @@ single_undo_checkpoint_p (void)
/* Save symbol with the information necessary to back it out. */
-static void
-save_symbol_data (gfc_symbol *sym)
+void
+gfc_save_symbol_data (gfc_symbol *sym)
{
gfc_symbol *s;
unsigned i;
@@ -2860,7 +2860,7 @@ gfc_get_sym_tree (const char *name, gfc_namespace *ns, gfc_symtree **result,
p->mark = 1;
/* Copy in case this symbol is changed. */
- save_symbol_data (p);
+ gfc_save_symbol_data (p);
}
*result = st;
@@ -2899,7 +2899,7 @@ gfc_get_ha_sym_tree (const char *name, gfc_symtree **result)
if (st != NULL)
{
- save_symbol_data (st->n.sym);
+ gfc_save_symbol_data (st->n.sym);
*result = st;
return i;
}