From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2100) id 2F35A3850419; Sat, 22 Aug 2020 22:37:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F35A3850419 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1598135841; bh=6XhvU/KrFf0imHfQGk2HRExz12q1bK1ghknPX9689Z4=; h=From:To:Subject:Date:From; b=b+S+7cW090YlaaYiWmP8NV3VjPZTT9xWZvHrLLAyLnDcCn14nvpVikF1+1uuYCWhc kq+a6czNk6bxLflorLl9/eH3yZ7+QZ3RD9PR601ceKB8GiTF0/ITflP4P/Zxmo0e16 ObkV/2sG/QelC5nEQZqrRxxnDqCOmi//9wFrhoyY= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Giuliano Belinassi To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/autopar_devel] [Ada] Crash in tagged type constructor with task components X-Act-Checkin: gcc X-Git-Author: Javier Miranda X-Git-Refname: refs/heads/devel/autopar_devel X-Git-Oldrev: 5dd1d908152c7fec454178ca169562a9800e23d1 X-Git-Newrev: 70d4908d56cc85c1e0a6a26177e7cf2d971806c2 Message-Id: <20200822223721.2F35A3850419@sourceware.org> Date: Sat, 22 Aug 2020 22:37:21 +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: Sat, 22 Aug 2020 22:37:21 -0000 https://gcc.gnu.org/g:70d4908d56cc85c1e0a6a26177e7cf2d971806c2 commit 70d4908d56cc85c1e0a6a26177e7cf2d971806c2 Author: Javier Miranda Date: Sat Apr 4 14:21:40 2020 -0400 [Ada] Crash in tagged type constructor with task components 2020-06-16 Javier Miranda gcc/ada/ * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings): Code cleanup. Diff: --- gcc/ada/sem_prag.adb | 51 ++++----------------------------------------------- 1 file changed, 4 insertions(+), 47 deletions(-) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 673954acb5b..f3f0affb0ca 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -10694,54 +10694,11 @@ package body Sem_Prag is Add_To_Config_Boolean_Restrictions (No_Elaboration_Code); end if; - -- Special processing for No_Tasking restriction + -- Special processing for No_Tasking restriction placed in + -- a configuration pragmas file. - elsif R_Id = No_Tasking then - - -- Handle global configuration pragmas - - if No (Cunit (Main_Unit)) then - Set_Global_No_Tasking; - - -- Handle package System, which may be loaded by rtsfind as - -- a consequence of loading some other run-time unit. - - else - declare - C_Node : constant Entity_Id := - Cunit (Current_Sem_Unit); - C_Ent : constant Entity_Id := - Cunit_Entity (Current_Sem_Unit); - Loc_Str : constant String := - Build_Location_String (Sloc (C_Ent)); - Ref_Str : constant String := "system.ads"; - Ref_Len : constant Positive := Ref_Str'Length; - - begin - pragma Assert (Loc_Str'First = 1); - pragma Assert (Loc_Str'First = Ref_Str'First); - - if Nkind (Unit (C_Node)) = N_Package_Declaration - and then Chars (C_Ent) = Name_System - - -- Handle child packages named foo-system.ads - - and then Loc_Str'Length > Ref_Str'Length - and then Loc_Str (Loc_Str'First .. Ref_Len) - = Ref_Str (Ref_Str'First .. Ref_Len) - - -- ... and ensure that package System has not - -- been previously loaded. Done to ensure that - -- the above checks do not have any corner case - -- (since they are performed without semantic - -- information). - - and then not RTU_Loaded (Rtsfind.System) - then - Set_Global_No_Tasking; - end if; - end; - end if; + elsif R_Id = No_Tasking and then No (Cunit (Main_Unit)) then + Set_Global_No_Tasking; end if; -- If this is a warning, then set the warning unless we already