public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/55868] [4.8 Regression] gfortran generates for CLASS(*)   __m_MOD___vtab__$tar on NO_DOLLAR_IN_LABEL systems
Date: Tue, 08 Jan 2013 09:37:00 -0000	[thread overview]
Message-ID: <bug-55868-4-qQJluqYtS7@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55868-4@http.gcc.gnu.org/bugzilla/>


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");


  parent reply	other threads:[~2013-01-08  9:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-03 17:28 [Bug fortran/55868] New: " burnus at gcc dot gnu.org
2013-01-07 14:00 ` [Bug fortran/55868] [4.8 Regression] " burnus at gcc dot gnu.org
2013-01-08  9:13 ` jakub at gcc dot gnu.org
2013-01-08  9:37 ` burnus at gcc dot gnu.org [this message]
2013-01-08  9:41 ` jakub at gcc dot gnu.org
2013-01-12 12:53 ` pault at gcc dot gnu.org
2013-01-12 12:58 ` pault at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-55868-4-qQJluqYtS7@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).