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 r11-5419] [Ada] Crash on task declaration with Restriction_Warning (No_Tasking)
Date: Thu, 26 Nov 2020 08:42:36 +0000 (GMT)	[thread overview]
Message-ID: <20201126084237.04C4B396E45E@sourceware.org> (raw)

https://gcc.gnu.org/g:52424b13d80af31b6004995c1910fb9ee0ab1939

commit r11-5419-g52424b13d80af31b6004995c1910fb9ee0ab1939
Author: Ed Schonberg <schonberg@adacore.com>
Date:   Tue Oct 27 09:24:51 2020 -0400

    [Ada] Crash on task declaration with Restriction_Warning (No_Tasking)
    
    gcc/ada/
    
            * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
            when the restriction is a configuration pragma and specifies
            No_Tasking, a global flag is set to reject task declarations,
            and to prevent the construction of Master entities. The flag
            must not be set if the pragma is a Restriction_Warning, in which
            case task declarationns are allowed.

Diff:
---
 gcc/ada/sem_prag.adb | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 9c57ee31c89..02cf0bc5648 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -10438,10 +10438,13 @@ package body Sem_Prag is
                      Add_To_Config_Boolean_Restrictions (No_Elaboration_Code);
                   end if;
 
-               --  Special processing for No_Tasking restriction placed in
-               --  a configuration pragmas file.
+               --  Special processing for No_Tasking restriction (not just a
+               --  warning) when it appears as a configuration pragmas.
 
-               elsif R_Id = No_Tasking and then No (Cunit (Main_Unit)) then
+               elsif R_Id = No_Tasking
+                 and then No (Cunit (Main_Unit))
+                 and then not Warn
+               then
                   Set_Global_No_Tasking;
                end if;


                 reply	other threads:[~2020-11-26  8:42 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=20201126084237.04C4B396E45E@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).