public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Janus Weil <janus@gcc.gnu.org>
To: "Tobias Schlüter" <tobias.schlueter@physik.uni-muenchen.de>
Cc: Tobias Burnus <burnus@net-b.de>,
	Dominique Dhumieres <dominiq@lps.ens.fr>,
	fortran <fortran@gcc.gnu.org>,
		gcc-patches <gcc-patches@gcc.gnu.org>,
	tkoenig <tkoenig@netcologne.de>
Subject: Re: [Patch, Fortran, OOP] PR 46313: OOP-ABI issue, ALLOCATE issue, CLASS renaming issue
Date: Sun, 07 Nov 2010 15:50:00 -0000	[thread overview]
Message-ID: <AANLkTinw12kR=QBiFqHqBWDYwgiZERxDGhrpEq=Y=9OV@mail.gmail.com> (raw)
In-Reply-To: <4CD6C713.2020709@physik.uni-muenchen.de>

>>>>>> Yes, that is expected, because the patch changes the name of the vtab
>>>>>> to "vtab$main$dt", so one needs to change the name of the subroutine
>>>>>> in the test case in the same way in order to see the failure:
>>>
>>> Sorry I'm late, but gcc has the macro ASM_FORMAT_PRIVATE_NAME which does
>>> the work of making a name collision-free. If you use it you can make the
>>> rest of the name as readable as you want.
>>
>> I think that it won't work. One needs the same assembler name for in
>> each translation unit as there is one, common, global vtable per base
>> type. My understanding is that ASM_FORMAT_PRIVATE_NAME would generate
>> several disjunct assembler names...
>
> I don't think so, it only adds a platform-dependent character to the
> variable name.  The offered varieties cover exactly what was suggested in
> this thread so far:
>
> #ifndef ASM_PN_FORMAT
> # ifndef NO_DOT_IN_LABEL
> #  define ASM_PN_FORMAT "%s.%lu"
> # else
> #  ifndef NO_DOLLAR_IN_LABEL
> #   define ASM_PN_FORMAT "%s$%lu"
> #  else
> #   define ASM_PN_FORMAT "__%s_%lu"
> #  endif
> # endif
> #endif /* ! ASM_PN_FORMAT */
>
> #ifndef ASM_FORMAT_PRIVATE_NAME
> # define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
>  do { const char *const name_ = (NAME); \
>       char *const output_ = (OUTPUT) = \
>         (char *) alloca (strlen (name_) + 32); \
>       sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \
>  } while (0)
> #endif

Yes, I think it would do the job. But we actually do not need the
additional number.

Btw, what is the reason for the macro adding *two* underscores in
front, instead of just one?

Cheers,
Janus

  reply	other threads:[~2010-11-07 15:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-06 23:34 Dominique Dhumieres
2010-11-06 23:56 ` Janus Weil
2010-11-07  7:55   ` Tobias Burnus
2010-11-07 12:04     ` Janus Weil
2010-11-07 12:11       ` Tobias Schlüter
2010-11-07 13:19         ` Tobias Burnus
2010-11-07 14:21           ` Janus Weil
2010-11-07 15:34           ` Tobias Schlüter
2010-11-07 15:50             ` Janus Weil [this message]
2010-11-07 16:39               ` Tobias Schlüter
2010-11-07 16:30       ` Steve Kargl
  -- strict thread matches above, loose matches on Subject: below --
2010-11-06 20:11 Janus Weil
2010-11-06 21:03 ` Thomas Koenig
2010-11-06 21:23   ` Janus Weil
2010-11-07 16:52 ` Tobias Burnus
2010-11-07 18:44   ` Janus Weil
2010-11-08 13:27     ` Tobias Burnus
2010-11-09 10:41       ` Janus Weil
2018-09-17  8:59         ` Bernhard Reutner-Fischer
2018-09-17 19:22           ` Janus Weil
2018-09-17 20:25             ` Janus Weil
2018-09-19 14:50               ` Bernhard Reutner-Fischer
2018-09-20 19:36                 ` Janus Weil

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='AANLkTinw12kR=QBiFqHqBWDYwgiZERxDGhrpEq=Y=9OV@mail.gmail.com' \
    --to=janus@gcc.gnu.org \
    --cc=burnus@net-b.de \
    --cc=dominiq@lps.ens.fr \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tkoenig@netcologne.de \
    --cc=tobias.schlueter@physik.uni-muenchen.de \
    /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).