http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55868
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-01-08 09:37:00 UTC --- (In reply to comment #2) > I'd say GFC_PREFIX wouldn't improve this, I'd keep using $ unless > NO_DOLLAR_IN_LABEL, otherwise fallback to . if NO_DOT_IN_LABEL and as last > fallback use _ in this case. I actually wonder whether the $ or . is really needed. The leading "__" puts it firmly into the realm of the compiler and to avoid clashes with user-defined types, using upper case is enough as all user-defined type names are converted into lower case. Hence, the following untested patch should be enough. Another question is whether we want change at some point (e.g. ABI breaking due to the new array descriptor?) the __vtab mangling to contains a "." (if available) to reduce the chance of name clashes even further. --- a/gcc/fortran/class.c +++ b/gcc/fortran/class.c @@ -464 +464 @@ get_unique_type_string (char *string, gfc_symbol *derived) - sprintf (dt_name, "%s", "$tar"); + sprintf (dt_name, "%s", "STAR"); diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 3a36cad..fef44d5 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -2769 +2769 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag) - gfc_find_symbol ("$tar", gfc_current_ns, 1, &upe); + gfc_find_symbol ("STAR", gfc_current_ns, 1, &upe); @@ -2772,2 +2772,2 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int - upe = gfc_new_symbol ("$tar", gfc_current_ns); - st = gfc_new_symtree (&gfc_current_ns->sym_root, "$tar"); + upe = gfc_new_symbol ("STAR", gfc_current_ns); + st = gfc_new_symtree (&gfc_current_ns->sym_root, "STAR"); @@ -2788 +2788 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag) - st = gfc_find_symtree (gfc_current_ns->sym_root, "$tar"); + st = gfc_find_symtree (gfc_current_ns->sym_root, "STAR"); @@ -2790 +2790 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag) - st = gfc_new_symtree (&gfc_current_ns->sym_root, "$tar"); + st = gfc_new_symtree (&gfc_current_ns->sym_root, "STAR");