public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexandre Oliva <oliva@adacore.com>
To: gcc@gcc.gnu.org
Cc: Richard Biener <richard.guenther@gmail.com>,
	Jan Hubicka <hubicka@ucw.cz>, Nathan Sidwell <nathan@acm.org>,
	jason@redhat.com, joseph@codesourcery.com, hainque@adacore.com,
	ebotcazou@adacore.com
Subject: Last call for bikeshedding on attribute sym/exalias/reverse_alias
Date: Fri, 08 Sep 2023 02:25:38 -0300	[thread overview]
Message-ID: <orpm2tgrsd.fsf_-_@lxoliva.fsfla.org> (raw)
In-Reply-To: <orwmyvzece.fsf_-_@lxoliva.fsfla.org> (Alexandre Oliva's message of "Wed, 19 Jul 2023 20:11:29 -0300")

Since 2020 I've been trying to introduce an attribute that operates a
bit like alias, but instead of defining a declaration as an alias to
another defined declaration, it merely exposes the present declaration
with an alternate mnemonic symbol name, so that it can be further
aliased, imported or referenced elsewhere with an invariant name, rather
than with a mangled name.  E.g.:

// C++
namespace foo {
  int __attribute__ ((__???__ ("FOOVAR")))
  var = 42; // FOOVAR is an asm alias to the mangled name for foo::var
}

--  Ada
package Foo is
  Var : Integer;
  pragma Import (CPP, FooVar, "FOOVAR");
  --  use the mnemonic alias rather than the mangled name.


The implementation also handles C++ cdtors, modifying the mnemonic alias
of each clone so that they don't clash, and typeinfo objects generated
for classes when the attribute is associated with a class.


There don't seem to be objections to the feature per se, but discussions
about it have invariably got stuck in debating the attribute name.

https://gcc.gnu.org/pipermail/gcc-patches/2020-August/551614.html
https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624560.html
https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624977.html


The customer report that motivated this development didn't require its
full generality, and asm("symbol") satisfies it.  But I've implemented
the feature, I find it useful, others seem to have liked it, and so I'd
like it to find its way into GCC.  However, I'm advised to not spend
much more time on it.

So, instead of updating the patch for every suggested attribute name, my
last-attempt plan is to try to reach consensus on the attribute name,
and then adjust the patch and submit it one more time.  If that doesn't
succeed, I'll leave it for anyone else to take it from there.

Attribute sym, named after symver, is the one in the latest version of
the patch.  mnemonic_alias, convenience_alias and asm_alias are other
possibilities that comes to mind.  The 2020-August thread has many more.

-- 
Alexandre Oliva, happy hacker            https://FSFLA.org/blogs/lxo/
   Free Software Activist                   GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity
Excluding neuro-others for not behaving ""normal"" is *not* inclusive

       reply	other threads:[~2023-09-08  5:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <or365aghwf.fsf@livre.home>
     [not found] ` <orzh7673v4.fsf@livre.home>
     [not found]   ` <ory1ji6ky5.fsf_-_@lxoliva.fsfla.org>
     [not found]     ` <e4d300a4-d84a-556b-d94f-904047ab5120@acm.org>
     [not found]       ` <orh6q13ks2.fsf@lxoliva.fsfla.org>
     [not found]         ` <CAFiYyc0TwLXgSUvFYp1BWkN-MvTTcwqHCj7YSybQrzaUn3=LYA@mail.gmail.com>
     [not found]           ` <orwmyvzece.fsf_-_@lxoliva.fsfla.org>
2023-09-08  5:25             ` Alexandre Oliva [this message]
2023-09-08  6:01               ` Dave Blanchard
2023-09-08  7:34                 ` Jonathan Wakely
2023-09-08  8:32               ` Jonathan Wakely
2023-09-08  8:46                 ` Roy Jacobson
2023-09-14 10:01                 ` Alexandre Oliva

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=orpm2tgrsd.fsf_-_@lxoliva.fsfla.org \
    --to=oliva@adacore.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc@gcc.gnu.org \
    --cc=hainque@adacore.com \
    --cc=hubicka@ucw.cz \
    --cc=jason@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=nathan@acm.org \
    --cc=richard.guenther@gmail.com \
    /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).