From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by sourceware.org (Postfix) with ESMTPS id 0BCA23858D1E for ; Fri, 8 Sep 2023 05:25:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0BCA23858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-1c0fcbf7ae4so1373594fac.0 for ; Thu, 07 Sep 2023 22:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1694150758; x=1694755558; darn=gcc.gnu.org; h=mime-version:user-agent:message-id:in-reply-to:date:errors-to :references:organization:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Qdrh223+ktJWWcThntkTA/lvMOGznL1WolsCRDU2CbY=; b=DIZnE6emfNAulDypnPfoPVzszYKx66DTkh2DXo2mUTsiqBla9XhNjI2Y5K1mZYBn3v V5Y+2KD8aEnl8dCq0jCsCbV0hNBd3px2307xBjx7GbZZIMSlPyS4TEKIMR/mUJsTDQwM /uVpFVpQA3tjFWWNf6TLbJ7pfgT4ILk/3OWAJs3wcbFIx8dkgHyjutZTjutHA4+IvqRW b36MB0P84eExZ/L3KvvoJX8/m8uQVC+L71E4UEZfLmEGhT/9kldsLVKYxuCl+AvQGHtr wxQa9dl21B7ofrUNSu982RnPqn6jMjaZryBSqfsYzgN8eUXYSEMCThv+hv14d78Mwr73 PYJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694150758; x=1694755558; h=mime-version:user-agent:message-id:in-reply-to:date:errors-to :references:organization:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Qdrh223+ktJWWcThntkTA/lvMOGznL1WolsCRDU2CbY=; b=tUWFWxo/XS4lx0po+4FWnjGAKKDXW9mjGhYrVMMreT8KO+16D+zgeamtsd8Z4CCVDU A38N1J16vSjAmN6IW0cGiezItu9XDE7UIkrqQwPRVEmvP1B2Genz8yopWFQxoJBpR82Z VXqGPvbnrNaq/bTZbyuga3h8QkdiRRm9tmbf2YT2zkSJB4ohF2P9eXjJlAg9Q2gUi57u ULt0F3GFKxCoH6ROFdPe6I0ogTy0Uu/l1Gda0f8Gp176oAW30ZsU+mMmMLnVp6tJ71Uc pcsRyFLwlti5GyLdXARK0y/GgPFdJxs/1Q6/UeDXGkMIaw7pCLw0Foc+A1ofQ51YkqO2 3xeA== X-Gm-Message-State: AOJu0YwOt3hGRUiZCnsbAs/do/52/eK40LeRbrTOhE4Be/awQFXl1hfj qhK/3iccQMajTXpErSxlMTgZHh9/ptZWgOl/+3lKXQt6 X-Google-Smtp-Source: AGHT+IFTpzepg2JbgHjCh4rldEFsh2Bh3qaaI5xYUFc/WryR+BQ1xpD1BW2Sb/2VjmRwfQq5TdNWWQ== X-Received: by 2002:a05:6870:3291:b0:1be:fcb8:6a48 with SMTP id q17-20020a056870329100b001befcb86a48mr1621054oac.58.1694150758077; Thu, 07 Sep 2023 22:25:58 -0700 (PDT) Received: from free.home ([2804:7f1:2080:4caa:1462:c30f:2c4a:9067]) by smtp.gmail.com with ESMTPSA id o129-20020a4a4487000000b0055ab0abaf31sm445005ooa.19.2023.09.07.22.25.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 22:25:57 -0700 (PDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 3885PcZp245805 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 8 Sep 2023 02:25:39 -0300 From: Alexandre Oliva To: gcc@gcc.gnu.org Cc: Richard Biener , Jan Hubicka , Nathan Sidwell , jason@redhat.com, joseph@codesourcery.com, hainque@adacore.com, ebotcazou@adacore.com Subject: Last call for bikeshedding on attribute sym/exalias/reverse_alias Organization: Free thinker, does not speak for AdaCore References: Errors-To: aoliva@lxoliva.fsfla.org Date: Fri, 08 Sep 2023 02:25:38 -0300 In-Reply-To: (Alexandre Oliva's message of "Wed, 19 Jul 2023 20:11:29 -0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: 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