public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-549] [Ada] Restore defensive guard in checks for volatile actuals
Date: Tue, 17 May 2022 08:29:50 +0000 (GMT)	[thread overview]
Message-ID: <20220517082950.8C8EF3858016@sourceware.org> (raw)

https://gcc.gnu.org/g:33400df641d834ca3fd3f2c964ed92759f128ffa

commit r13-549-g33400df641d834ca3fd3f2c964ed92759f128ffa
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Wed Mar 30 12:00:20 2022 +0200

    [Ada] Restore defensive guard in checks for volatile actuals
    
    When flagging names of volatile objects occurring in actual parameters
    it is safer to guard against identifiers without entity. This is
    redundant (because earlier in the resolution of actual parameters we
    already guard against actuals with Any_Type), but perhaps such
    identifiers will become allowed in constructs like:
    
       Subprogram_Call
         (Actual =>
            (declare
               X : Boolean := ...
                 with Annotate (GNATprove, ...)));
                                ^^^^^^^^^
    
    which include an identifier that does not denote any entity.
    
    Code cleanup related to handling of volatile components; behaviour is
    unaffected.
    
    gcc/ada/
    
            * sem_res.adb (Flag_Effectively_Volatile_Objects): Restore
            redundant guard.

Diff:
---
 gcc/ada/sem_res.adb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 12735daab6d..33f445d69b9 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -3873,7 +3873,8 @@ package body Sem_Res is
                   --  selector_name in selected_component or as a choice in
                   --  component_association.
 
-                  if Is_Object (Id)
+                  if Present (Id)
+                    and then Is_Object (Id)
                     and then Ekind (Id) not in E_Component | E_Discriminant
                     and then Is_Effectively_Volatile_For_Reading (Id)
                     and then


                 reply	other threads:[~2022-05-17  8:29 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=20220517082950.8C8EF3858016@sourceware.org \
    --to=pmderodat@gcc.gnu.org \
    --cc=gcc-cvs@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).