From: Arnaud Charlet Date: Wed, 18 Nov 2015 10:12:27 +0000 (+0100) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a99fda7cc9576f48f3eafbc00ed349bbb2d178d;p=gcc.git [multiple changes] 2015-11-18 Arnaud Charlet * interfac.ads (Unsigned_24): New type. * sem_ch13.adb (Validate_Unchecked_Conversion): Disable error on unconstrained arrays in Relaxed_RM_Semantics mode. 2015-11-18 Vincent Celier * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking): No warning is withed unit is the interface of a Stand-Alone Library. From-SVN: r230527 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 39e407bada3..d462f2f0e23 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2015-11-18 Arnaud Charlet + + * interfac.ads (Unsigned_24): New type. + * sem_ch13.adb (Validate_Unchecked_Conversion): Disable error on + unconstrained arrays in Relaxed_RM_Semantics mode. + +2015-11-18 Vincent Celier + + * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking): No + warning is withed unit is the interface of a Stand-Alone Library. + 2015-11-18 Thomas Quinot * s-os_lib.ads, s-os_lib.adb(Normalize_Pathname): Support the case of diff --git a/gcc/ada/bcheck.adb b/gcc/ada/bcheck.adb index 4170b0e8e0e..72a2cbd58a8 100644 --- a/gcc/ada/bcheck.adb +++ b/gcc/ada/bcheck.adb @@ -447,12 +447,13 @@ package body Bcheck is --------------------------------------------------- -- The rule here is that if a unit has dynamic elaboration checks, - -- then any unit it withs must meeting one of the following criteria: + -- then any unit it withs must meet one of the following criteria: -- 1. There is a pragma Elaborate_All for the with'ed unit -- 2. The with'ed unit was compiled with dynamic elaboration checks -- 3. The with'ed unit has pragma Preelaborate or Pure -- 4. It is an internal GNAT unit (including children of GNAT) + -- 5. It is an interface of a Stand-Aline Library procedure Check_Consistent_Dynamic_Elaboration_Checking is begin @@ -496,6 +497,11 @@ package body Bcheck is elsif Is_Internal_File_Name (WU.Sfile) then null; + -- Case 5. With'ed unit is a SAL interface + + elsif WU.SAL_Interface then + null; + -- Issue warning, not one of the safe cases else diff --git a/gcc/ada/interfac.ads b/gcc/ada/interfac.ads index 6e3afffe5ee..2c501a2dd28 100644 --- a/gcc/ada/interfac.ads +++ b/gcc/ada/interfac.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2002-2014, Free Software Foundation, Inc. -- +-- Copyright (C) 2002-2015, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -65,6 +65,11 @@ package Interfaces is type Unsigned_16 is mod 2 ** 16; for Unsigned_16'Size use 16; + type Unsigned_24 is mod 2 ** 24; + for Unsigned_24'Size use 24; + -- Declare this type for compatibility with legacy Ada compilers. + -- This is particularly useful in the context of CodePeer analysis. + type Unsigned_32 is mod 2 ** 32; for Unsigned_32'Size use 32; diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 56b81b43dae..d56bd2cde6e 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -13570,9 +13570,13 @@ package body Sem_Ch13 is Target := Underlying_Type (Target); end if; - -- Source may be unconstrained array, but not target + -- Source may be unconstrained array, but not target, except in relaxed + -- semantics mode. - if Is_Array_Type (Target) and then not Is_Constrained (Target) then + if Is_Array_Type (Target) + and then not Is_Constrained (Target) + and then not Relaxed_RM_Semantics + then Error_Msg_N ("unchecked conversion to unconstrained array not allowed", N); return;