aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/symbol.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2007-08-04 20:46:11 +0000
committerPaul Thomas <pault@gcc.gnu.org>2007-08-04 20:46:11 +0000
commitaa84a9a5e414aad8acbbdf4efae1f951bc9a1de7 (patch)
treedf679370a76da565ff23a0cbbdd8f61a1c342b7f /gcc/fortran/symbol.c
parent6b44ad312f943d9ae65ad6db8f4be0640eefec6e (diff)
downloadgcc-aa84a9a5e414aad8acbbdf4efae1f951bc9a1de7.zip
gcc-aa84a9a5e414aad8acbbdf4efae1f951bc9a1de7.tar.gz
gcc-aa84a9a5e414aad8acbbdf4efae1f951bc9a1de7.tar.bz2
re PR fortran/31214 (User-defined operator using entry leads to ICE)
2007-08-04 Paul Thomas <pault@gcc.gnu.org> PR fortran/31214 * symbol.c (get_unique_symtree): Moved from module.c. * module.c (get_unique_symtree): Moved to symbol.c. * decl.c (get_proc_name): Transfer the typespec from the local symbol to the module symbol, in the case that an entry is also a module procedure. Ensure the local symbol is cleaned up by pointing to it with a unique symtree. * dump_parse_tree (gfc_show_code_node): Add EXEC_ASSIGN_CALL. 2007-08-04 Paul Thomas <pault@gcc.gnu.org> PR fortran/31214 * gfortran.dg/entry_13.f90: New test. * gfortran.dg/entry_12.f90: Clean up .mod file. From-SVN: r127213
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r--gcc/fortran/symbol.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 40e3435..3aae04c 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -2129,6 +2129,20 @@ gfc_find_symtree (gfc_symtree *st, const char *name)
}
+/* Return a symtree node with a name that is guaranteed to be unique
+ within the namespace and corresponds to an illegal fortran name. */
+
+gfc_symtree *
+gfc_get_unique_symtree (gfc_namespace *ns)
+{
+ char name[GFC_MAX_SYMBOL_LEN + 1];
+ static int serial = 0;
+
+ sprintf (name, "@%d", serial++);
+ return gfc_new_symtree (&ns->sym_root, name);
+}
+
+
/* Given a name find a user operator node, creating it if it doesn't
exist. These are much simpler than symbols because they can't be
ambiguous with one another. */