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 r12-1474] [Ada] Incorrect Reinit_Field_To_Zero calls for concurrent entities
Date: Tue, 15 Jun 2021 10:22:43 +0000 (GMT)	[thread overview]
Message-ID: <20210615102243.AED5A398B89E@sourceware.org> (raw)

https://gcc.gnu.org/g:40f464256cb547f8663f44965d7bb8a68527be6b

commit r12-1474-g40f464256cb547f8663f44965d7bb8a68527be6b
Author: Bob Duff <duff@adacore.com>
Date:   Sun Feb 14 15:27:12 2021 -0500

    [Ada] Incorrect Reinit_Field_To_Zero calls for concurrent entities
    
    gcc/ada/
    
            * sem_ch3.adb (Make_Class_Wide_Type): Make sure all the calls to
            Reinit_Field_To_Zero are for the correct Ekinds.

Diff:
---
 gcc/ada/sem_ch3.adb | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 11c6fdbed6b..03280e5244e 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -19239,14 +19239,17 @@ package body Sem_Ch3 is
          Reinit_Field_To_Zero (CW_Type, Private_Dependents);
 
       elsif Ekind (CW_Type) in Concurrent_Kind then
-         if Ekind (CW_Type) = E_Task_Type then
+         Reinit_Field_To_Zero (CW_Type, First_Private_Entity);
+         Reinit_Field_To_Zero (CW_Type, Scope_Depth_Value);
+
+         if Ekind (CW_Type) in Task_Kind then
             Reinit_Field_To_Zero (CW_Type, Is_Elaboration_Checks_OK_Id);
             Reinit_Field_To_Zero (CW_Type, Is_Elaboration_Warnings_OK_Id);
          end if;
 
-         Reinit_Field_To_Zero (CW_Type, First_Private_Entity);
-         Reinit_Field_To_Zero (CW_Type, Scope_Depth_Value);
-         Reinit_Field_To_Zero (CW_Type, SPARK_Aux_Pragma_Inherited);
+         if Ekind (CW_Type) in E_Task_Type | E_Protected_Type then
+            Reinit_Field_To_Zero (CW_Type, SPARK_Aux_Pragma_Inherited);
+         end if;
       end if;
 
       Mutate_Ekind                    (CW_Type, E_Class_Wide_Type);


                 reply	other threads:[~2021-06-15 10:22 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=20210615102243.AED5A398B89E@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).