From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id 5C2A23858D1E for ; Fri, 8 Sep 2023 08:46:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C2A23858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-53fa455cd94so1412338a12.2 for ; Fri, 08 Sep 2023 01:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694162799; x=1694767599; darn=gcc.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=qX/jcFEAEDKwP11hGs9GTgHu7ICoAieqiW8jw35C40g=; b=iZ0eGuX3JgAZ77fGW819Q2B6ysjCO6sAu6TFDCfMkKtILvJr8B+iIeTgIen1lFFwcT VFIUq/GUm9FKXOIMwXLYottGTa1q9TqM/82mHPL4cdh6FaNBiBIiniAQU0Hl1wmcPUui 6ECMx/KixXMLMAaOPtIb/8R5ym4944nGP8tNaSc3VSd6Mf+6r2klN4cnaxqEIjHCSDNS NlBqMbptlzt2XgLbxM1Bs/5ZYfmtHnwXUGocxfUb62wO5HX6Mbwvm5uNZMBHiSBWgnZZ UThbqtm0McfV4Vnd7m66CnpW2Pod3h8pK54eMZVdSBJoAsDXgwfWJveO3o5ZeVyeTzz6 Jaeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694162799; x=1694767599; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qX/jcFEAEDKwP11hGs9GTgHu7ICoAieqiW8jw35C40g=; b=X0WAqZqOhN8IUBjomNGOszUr+WmFkD+ddLpqHCo/sWpVTs7XyUbwXdF2x74bo2aFLD fNU4n+QtXYcfiGbpRuWs4RBLhsgGG24NKcmJiH+B2E0VzZm81E6kl4yQLwudddpFkvrs dXzJ7UoWonn5RuTHVLESmUa6HZsUj7IdrqQy14rWJns8qBEltNR+Ra+YskXaPRQQwl00 GuEpO/ks5omrmN/ysj8XGz3D6cacDRUTa23kpiNysVs5ig3J6e8AxDybHzvVRt6dLnPk k5i4AI2mYjUlICsQanWcVYWA3dNmGRUQYhAdSH+HCZCVwNdtQlfuBBFprHcRyfY3kjqp 9Cmw== X-Gm-Message-State: AOJu0Yykkc00UCRC/k5q28zndv69Ek4poH1l29grf4u9s162aQkXZp67 tusvrA1J+2LzdcOF5OQVdNlhzpOQ6SeUykdRoiI= X-Google-Smtp-Source: AGHT+IFw37FrPglYILtp87jHQNgIlaZM7wIPYt4kOquuVYrS5W0rmWnagIpHhgCloj8KzFFLSdkVms83XxSfekqAPoc= X-Received: by 2002:a17:90a:72c2:b0:269:6c5:11a7 with SMTP id l2-20020a17090a72c200b0026906c511a7mr1916989pjk.17.1694162798940; Fri, 08 Sep 2023 01:46:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Roy Jacobson Date: Fri, 8 Sep 2023 11:46:25 +0300 Message-ID: Subject: Re: Last call for bikeshedding on attribute sym/exalias/reverse_alias To: Jonathan Wakely Cc: Alexandre Oliva , gcc@gcc.gnu.org, Nathan Sidwell , Eric Botcazou , Jan Hubicka , "Joseph S. Myers" Content-Type: multipart/alternative; boundary="000000000000d296c90604d503fb" X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,WEIRD_QUOTING autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000d296c90604d503fb Content-Type: text/plain; charset="UTF-8" There's a related [[preferred_name]] attribute in Clang but it's not a success story. If you come up with something more usable I think we'll be happy to implement it as well :) https://clang.llvm.org/docs/AttributeReference.html#preferred-name On Fri, 8 Sept 2023, 11:34 Jonathan Wakely via Gcc, wrote: > On Fri, 8 Sept 2023, 06:26 Alexandre Oliva via Gcc, > wrote: > > > 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. > > > > Very cool, we have immediate uses for this in libstdc++. > > Personally I think calling it some form of "alias" focuses on the > implementation details of how its done behind the scenes, not what its > practical effects are. On the other hand, it would relate it to the > existing alias attribute which is related. > > I think "symname" or "symalias" would be better than just "sym". > > Have you contacted anybody in the llvm community to see if they would > implement it, or maybe already have something similar by another name? > > > > > > > > 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 > > > --000000000000d296c90604d503fb--