From 3fdb58e2eb3b2dbb3ec9bb12daf8c02fcc387e9e Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 23 Oct 2014 12:09:31 +0200 Subject: [PATCH] [multiple changes] 2014-10-23 Thomas Quinot * bcheck.adb (Check_Consistent_SSO_Default): Exclude internal units from consistency check. * gnat_rm.texi (Default_Scalar_Storage_Order): Document that consistency check excludes run-time units. 2014-10-23 Ed Schonberg * a-strsea.adb (Find_Token): Enable constraint checking in this procedure, so that even when compiling with checks suppressed, as is the case for the run-time, an exception is raised in this routine when the input meets the conditions described in RM 2005 A.4.3 (68/1). From-SVN: r216580 --- gcc/ada/ChangeLog | 14 ++++++++++++++ gcc/ada/a-strsea.adb | 8 ++++++++ gcc/ada/bcheck.adb | 18 ++++++++++++++++-- gcc/ada/gnat_rm.texi | 4 ++-- 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f431f804d0a..c07d3eef96d 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,17 @@ +2014-10-23 Thomas Quinot + + * bcheck.adb (Check_Consistent_SSO_Default): Exclude internal + units from consistency check. + * gnat_rm.texi (Default_Scalar_Storage_Order): Document that + consistency check excludes run-time units. + +2014-10-23 Ed Schonberg + + * a-strsea.adb (Find_Token): Enable constraint checking in this + procedure, so that even when compiling with checks suppressed, as is + the case for the run-time, an exception is raised in this routine when + the input meets the conditions described in RM 2005 A.4.3 (68/1). + 2014-10-20 Eric Botcazou * sem_ch3.adb (Build_Derived_Private_Type): When the parent diff --git a/gcc/ada/a-strsea.adb b/gcc/ada/a-strsea.adb index f1fb352fe0b..2651dc8d989 100644 --- a/gcc/ada/a-strsea.adb +++ b/gcc/ada/a-strsea.adb @@ -241,6 +241,14 @@ package body Ada.Strings.Search is First : out Positive; Last : out Natural) is + + -- RM 2005 A.4.3 (68/1)) specifies that an exception must be raised if + -- Source'First is not positive and is assigned to First. Formulation + -- is slightly different in RM 2012, but the intent seems similar, so + -- we enable range checks for this routine. + + pragma Unsuppress (Range_Check); + begin for J in Source'Range loop if Belongs (Source (J), Set, Test) then diff --git a/gcc/ada/bcheck.adb b/gcc/ada/bcheck.adb index be48f06fecf..dd723b36910 100644 --- a/gcc/ada/bcheck.adb +++ b/gcc/ada/bcheck.adb @@ -1077,16 +1077,28 @@ package body Bcheck is -- Check_Consistent_SSO_Default -- ---------------------------------- + -- This routine checks for a consistent SSO default setting. Note that + -- internal units are excluded from this check, since we don't in any + -- case allow the pragma to affect types in internal units, and there + -- is thus no requirement to recompile the run-time with the default set. + procedure Check_Consistent_SSO_Default is Default : Character; begin Default := ALIs.Table (ALIs.First).SSO_Default; + -- The default must be set from a non-internal unit + + pragma Assert + (not Is_Internal_File_Name (ALIs.Table (ALIs.First).Sfile)); + -- Check all entries match the default above from the first entry for A1 in ALIs.First + 1 .. ALIs.Last loop - if ALIs.Table (A1).SSO_Default /= Default then + if not Is_Internal_File_Name (ALIs.Table (A1).Sfile) + and then ALIs.Table (A1).SSO_Default /= Default + then Default := '?'; exit; end if; @@ -1132,7 +1144,9 @@ package body Bcheck is Write_Eol; for A1 in ALIs.First .. ALIs.Last loop - if ALIs.Table (A1).SSO_Default = ' ' then + if not Is_Internal_File_Name (ALIs.Table (A1).Sfile) + and then ALIs.Table (A1).SSO_Default = ' ' + then Write_Str (" "); Write_Name (ALIs.Table (A1).Sfile); Write_Eol; diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 425791f7fca..11a8d411104 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -2559,8 +2559,8 @@ types declared within that package spec or declarative part. If this pragma is used as a configuration pragma which appears within a configuration pragma file (as opposed to appearing explicitly at the start of a single unit), then the binder will require that all units in a partition -be compiled in a similar manner, including all units in the run-time that -are included in the partition. +be compiled in a similar manner, other than run-time units, which are not +affected by this pragma. The following example shows the use of this pragma: -- 2.30.2