From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id B1DB93857B82; Mon, 4 Jul 2022 07:49:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B1DB93857B82 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-1420] [Ada] Adjust description of Pure_Function pragma X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: d74d98784a9d0101aad8095d692193a74a2f62f6 X-Git-Newrev: ad7ed87a43655162cbd5765445681870aa99a3a8 Message-Id: <20220704074941.B1DB93857B82@sourceware.org> Date: Mon, 4 Jul 2022 07:49:41 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2022 07:49:41 -0000 https://gcc.gnu.org/g:ad7ed87a43655162cbd5765445681870aa99a3a8 commit r13-1420-gad7ed87a43655162cbd5765445681870aa99a3a8 Author: Eric Botcazou Date: Mon May 23 09:48:49 2022 +0200 [Ada] Adjust description of Pure_Function pragma The current wording can be read as implying that the result of a call to a pure function does not depend on the context, which is incorrect. The pragma only guarantees the absence of side effects of such a call. gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst (Pure_Function): Fix ambiguous wording about context dependence. * gnat_rm.texi: Regenerate. Diff: --- gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst | 6 +++--- gcc/ada/gnat_rm.texi | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst index af85600f32a..4318a347028 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst @@ -5504,9 +5504,9 @@ overloaded declaration exists, in which case the pragma applies to all entities). It specifies that the function ``Entity`` is to be considered pure for the purposes of code generation. This means that the compiler can assume that there are no side effects, and -in particular that two calls with identical arguments produce the -same result. It also means that the function can be used in an -address clause. +in particular that two identical calls produce the same result in +the same context. It also means that the function can be used in +an address clause. Note that, quite deliberately, there are no static checks to try to ensure that this promise is met, so ``Pure_Function`` can be used diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index a7077e05b47..13cff21288f 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -21,7 +21,7 @@ @copying @quotation -GNAT Reference Manual , May 24, 2022 +GNAT Reference Manual , Jun 24, 2022 AdaCore @@ -7088,9 +7088,9 @@ overloaded declaration exists, in which case the pragma applies to all entities). It specifies that the function @code{Entity} is to be considered pure for the purposes of code generation. This means that the compiler can assume that there are no side effects, and -in particular that two calls with identical arguments produce the -same result. It also means that the function can be used in an -address clause. +in particular that two identical calls produce the same result in +the same context. It also means that the function can be used in +an address clause. Note that, quite deliberately, there are no static checks to try to ensure that this promise is met, so @code{Pure_Function} can be used