public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Marc Poulhiès" <poulhies@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Steve Baird <baird@adacore.com>
Subject: [Ada] Enable lock free protected implementation by default
Date: Tue, 6 Sep 2022 09:16:01 +0200	[thread overview]
Message-ID: <20220906071601.GA1280515@poulhies-Precision-5550> (raw)

[-- Attachment #1: Type: text/plain, Size: 2010 bytes --]

In the past, the Lock_Free aspect of a protected type (including an
anonymous type) defaulted to False. In the case where an explicit
"Lock_Free => True" aspect specification would be legal, the aspect now
defaults to True (which means that a lock-free implementation is used to
implement the type's protected operations); this is like the previous
behavior of the compiler with the -gnatd9 switch specified. Support for
the Lock_Free attribute (which should not be confused with the Lock_Free
aspect) is removed.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* debug.adb: Remove comment regarding the -gnatd9 switch.
	* doc/gnat_rm/implementation_defined_attributes.rst: Remove all
	mention of the Lock_Free attribute.
	* gnat_rm.texi, gnat_ugn.texi: Regenerate.
	* exp_attr.adb, sem_attr.adb: Remove all mention of the former
	Attribute_Lock_Free enumeration element of the Attribute_Id type.
	* sem_ch9.adb
	(Allows_Lock_Free_Implementation): Remove the Debug_Flag_9 test.
	Return False in the case of a protected function whose result type
	requires use of the secondary stack.
	(Satisfies_Lock_Free_Requirements): This functions checks for
	certain constructs and returns False if one is found. In the case
	of a protected function, there is no need to check to see if the
	protected object is being modified. So it is ok to omit *some*
	checks in the case of a protected function. But other checks which
	are required (e.g., the test for a reference to a variable that is
	not part of the protected object) were being incorrectly omitted.
	This could result in accepting "Lock_Free => True" aspect
	specifications that should be rejected.
	* snames.adb-tmpl: Name_Lock_Free no longer requires special
	treatment in Get_Pragma_Id or Is_Pragma_Name (because it is no
	longer an attribute name).
	* snames.ads-tmpl: Move the declaration of Name_Lock_Free to
	reflect the fact that it is no longer the name of an attribute.
	Delete Attribute_Lock_Free from the Attribute_Id enumeration type.

[-- Attachment #2: patch.diff.gz --]
[-- Type: application/gzip, Size: 49445 bytes --]

                 reply	other threads:[~2022-09-06  7:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220906071601.GA1280515@poulhies-Precision-5550 \
    --to=poulhies@adacore.com \
    --cc=baird@adacore.com \
    --cc=gcc-patches@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).