]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Thu, 20 Feb 2014 13:54:18 +0000 (14:54 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 20 Feb 2014 13:54:18 +0000 (14:54 +0100)
2014-02-20  Vincent Celier  <celier@adacore.com>

* gnatcmd.adb, make.adb, prj-makr.adb, clean.adb: Call
Stringt.Initialize in all project aware tools.

2014-02-20  Doug Rupp  <rupp@adacore.com>

* gnat_ugn.texi: Document gnatbind -X option.
* vms_data.ads: Minor warnings documentation reformatting.

2014-02-20  Ed Schonberg  <schonberg@adacore.com>

* exp_ch3.adb (Expand_Freeze_Array_Type): Only create invariant
procedure for a base type.

2014-02-20  Robert Dewar  <dewar@adacore.com>

* sem_ch4.adb (Analyze_Case_Expression): Get type from first
expression with type info.
* sem_ch13.adb: Minor reformatting.
* sem_eval.adb (Subtypes_Statically_Match): Make sure we return
False if predicates do not match on the two types.

2014-02-20  Arnaud Charlet  <charlet@adacore.com>

* sem_prag.adb (Analyze_Pragma [pragma Attach_Handler]):
In Relaxed_RM_Semantics mode, allow any static integer value,
for compatibility with other compilers.

From-SVN: r207948

12 files changed:
gcc/ada/ChangeLog
gcc/ada/clean.adb
gcc/ada/exp_ch3.adb
gcc/ada/gnat_ugn.texi
gcc/ada/gnatcmd.adb
gcc/ada/make.adb
gcc/ada/prj-makr.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch4.adb
gcc/ada/sem_eval.adb
gcc/ada/sem_prag.adb
gcc/ada/vms_data.ads

index 998272e6cf01ecc185dcb7f2ef4198cbd8af0f7e..13a2d013f3070a7c0bcaffc1044683ca35114e2e 100644 (file)
@@ -1,3 +1,32 @@
+2014-02-20  Vincent Celier  <celier@adacore.com>
+
+       * gnatcmd.adb, make.adb, prj-makr.adb, clean.adb: Call
+       Stringt.Initialize in all project aware tools.
+
+2014-02-20  Doug Rupp  <rupp@adacore.com>
+
+       * gnat_ugn.texi: Document gnatbind -X option.
+       * vms_data.ads: Minor warnings documentation reformatting.
+
+2014-02-20  Ed Schonberg  <schonberg@adacore.com>
+
+       * exp_ch3.adb (Expand_Freeze_Array_Type): Only create invariant
+       procedure for a base type.
+
+2014-02-20  Robert Dewar  <dewar@adacore.com>
+
+       * sem_ch4.adb (Analyze_Case_Expression): Get type from first
+       expression with type info.
+       * sem_ch13.adb: Minor reformatting.
+       * sem_eval.adb (Subtypes_Statically_Match): Make sure we return
+       False if predicates do not match on the two types.
+
+2014-02-20  Arnaud Charlet  <charlet@adacore.com>
+
+       * sem_prag.adb (Analyze_Pragma [pragma Attach_Handler]):
+       In Relaxed_RM_Semantics mode, allow any static integer value,
+       for compatibility with other compilers.
+
 2014-02-20  Vincent Celier  <celier@adacore.com>
 
        * errutil.adb (Initialize): Properly initialize entry in table
index 83e81cbe84004ce81bc919a944f87fae54ea50b9..49e3a5bdd140da57bdc293475f91c2156186577e 100644 (file)
@@ -39,6 +39,7 @@ with Prj.Tree; use Prj.Tree;
 with Prj.Util; use Prj.Util;
 with Sdefault;
 with Snames;
+with Stringt;
 with Switch;   use Switch;
 with Table;
 with Targparm; use Targparm;
@@ -1559,6 +1560,7 @@ package body Clean is
 
          Csets.Initialize;
          Snames.Initialize;
+         Stringt.Initialize;
 
          Prj.Tree.Initialize (Root_Environment, Gnatmake_Flags);
 
index 6cd46362f2ee4c6357e873efc7947f276cfacee9..6934363a565e0b287e801b5d7bad21e313981cb4 100644 (file)
@@ -6076,13 +6076,15 @@ package body Exp_Ch3 is
       end if;
 
       if Has_Invariants (Component_Type (Base))
+        and then Typ = Base
         and then In_Open_Scopes (Scope (Component_Type (Base)))
       then
          --  Generate component invariant checking procedure. This is only
          --  relevant if the array type is within the scope of the component
          --  type. Otherwise an array object can only be built using the public
          --  subprograms for the component type, and calls to those will have
-         --  invariant checks.
+         --  invariant checks. The invariant procedure is only generated for
+         --  a base type, not a subtype.
 
          Insert_Component_Invariant_Checks
            (N, Base, Build_Array_Invariant_Proc (Base, N));
index b61254db521f15e05f2c16c4797341ba354c529a..51efc05ce75d7e6676622882e991dbfa1eeadd98 100644 (file)
@@ -8484,6 +8484,16 @@ Default mode, in which sources are checked for consistency only if
 they are available.
 @end ifset
 
+@item ^-X@var{nnn}^/RETURN_CODES=POSIX^
+@cindex @option{^-X@var{nnn}^/RETURN_CODES=POSIX^} (@code{gnatbind})
+Set default exit status value, normally 0 for POSIX compliance.
+
+@ifset vms
+@item /RETURN_CODES=VMS
+@cindex @option{/RETURN_CODES=VMS} (@code{gnatbind})
+VMS default normal successful return value is 1.
+@end ifset
+
 @item ^-y^/ENABLE_LEAP_SECONDS^
 @cindex @option{^-y^/ENABLE_LEAP_SECONDS^} (@code{gnatbind})
 Enable leap seconds support in @code{Ada.Calendar} and its children.
index 5d8a935cb80597d83ce37b627e89cf634d9b1199..494fd4d9ceb7b5d21fce1355d9ebdf21c4cd4297 100644 (file)
@@ -44,6 +44,7 @@ with Prj.Util; use Prj.Util;
 with Sdefault;
 with Sinput.P;
 with Snames;   use Snames;
+with Stringt;
 with Table;
 with Targparm;
 with Tempdir;
@@ -1392,6 +1393,7 @@ begin
 
    Csets.Initialize;
    Snames.Initialize;
+   Stringt.Initialize;
 
    Prj.Tree.Initialize (Root_Environment, Gnatmake_Flags);
 
index 5078f0e1163b52353c76446e12983118242700d5..e8acb4e604a69212dacdea879776ec3bbd74ad67 100644 (file)
@@ -55,6 +55,7 @@ with Sdefault;
 with SFN_Scan;
 with Sinput.P;
 with Snames;   use Snames;
+with Stringt;
 
 pragma Warnings (Off);
 with System.HTable;
@@ -6411,6 +6412,7 @@ package body Make is
 
       Csets.Initialize;
       Snames.Initialize;
+      Stringt.Initialize;
 
       Prj.Initialize (Project_Tree);
 
index f6d71f46b90efa7225be7d1042a4da642e454128..4f4ab43c08c63aa8d3d4c22ebf6560525a0f8df6 100644 (file)
@@ -38,6 +38,7 @@ with Prj.Tree; use Prj.Tree;
 with Prj.Util; use Prj.Util;
 with Sdefault;
 with Snames;   use Snames;
+with Stringt;
 with Table;    use Table;
 with Tempdir;
 
@@ -804,6 +805,7 @@ package body Prj.Makr is
 
       Csets.Initialize;
       Snames.Initialize;
+      Stringt.Initialize;
 
       Prj.Initialize (No_Project_Tree);
 
index 79ca903cc626b76c695ca49e0c6542fbcada9832..4c85bfaee9a95e72b96b59da8b66d45999bd8a62 100644 (file)
@@ -86,7 +86,7 @@ package body Sem_Ch13 is
    --  size value. In this case, we reset the Alignment to unknown.
 
    procedure Build_Predicate_Functions (Typ : Entity_Id; N : Node_Id);
-   --  If Typ has predicates (indicated by Has_Predicates being set for Typ,
+   --  If Typ has predicates (indicated by Has_Predicates being set for Typ),
    --  then either there are pragma Predicate entries on the rep chain for the
    --  type (note that Predicate aspects are converted to pragma Predicate), or
    --  there are inherited aspects from a parent type, or ancestor subtypes.
index 8f93ad3970be6a2e3c57927d77be8543ee939221..12fffbda6127b7b75eae7c3e305e483ef96ebe07 100644 (file)
@@ -1356,11 +1356,15 @@ package body Sem_Ch4 is
       --  Local variables
 
       Expr      : constant Node_Id := Expression (N);
-      FirstX    : constant Node_Id := Expression (First (Alternatives (N)));
       Alt       : Node_Id;
       Exp_Type  : Entity_Id;
       Exp_Btype : Entity_Id;
 
+      FirstX : Node_Id := Empty;
+      --  First expression in the case for which there is some type information
+      --  available, i.e. it is not Any_Type, which can happen because of some
+      --  error, or from the use of e.g. raise Constraint_Error.
+
       Others_Present : Boolean;
       --  Indicates if Others was present
 
@@ -1379,9 +1383,17 @@ package body Sem_Ch4 is
       Alt := First (Alternatives (N));
       while Present (Alt) loop
          Analyze (Expression (Alt));
+
+         if No (FirstX) and then Etype (Expression (Alt)) /= Any_Type then
+            FirstX := Expression (Alt);
+         end if;
+
          Next (Alt);
       end loop;
 
+      --  Get our initial type from the first expression for which we got some
+      --  useful type information from the expression.
+
       if not Is_Overloaded (FirstX) then
          Set_Etype (N, Etype (FirstX));
 
index 629ce45dcba24ede0b56b9b10289d81f66ab9665..7857d80f1d4e9ab9f820b7a3d921a16ccbb62634 100644 (file)
@@ -4901,6 +4901,11 @@ package body Sem_Eval is
       then
          return False;
 
+      --  No match if predicates do not match
+
+      elsif not Predicates_Match then
+         return False;
+
       --  Scalar types
 
       elsif Is_Scalar_Type (T1) then
@@ -4955,7 +4960,7 @@ package body Sem_Eval is
             return True;
          end if;
 
-         --  Otherwise both types have bound that can be compared
+         --  Otherwise both types have bounds that can be compared
 
          declare
             LB1 : constant Node_Id := Type_Low_Bound  (T1);
@@ -4964,11 +4969,10 @@ package body Sem_Eval is
             HB2 : constant Node_Id := Type_High_Bound (T2);
 
          begin
-            --  If the bounds are the same tree node, then match if and only
-            --  if any predicates present also match.
+            --  If the bounds are the same tree node, then match (common case)
 
             if LB1 = LB2 and then HB1 = HB2 then
-               return Predicates_Match;
+               return True;
 
             --  Otherwise bounds must be static and identical value
 
index d01176061337b7ebbc997718b02dbbb5ecf0f448..eb1dbd11d39f682c94b991520dceb1ecad25f726 100644 (file)
@@ -11545,19 +11545,32 @@ package body Sem_Prag is
                --  be expanded in the init proc. If expansion is enabled, then
                --  perform semantic checks on a copy only.
 
-               if Expander_Active then
-                  declare
-                     Temp : constant Node_Id :=
-                              New_Copy_Tree (Get_Pragma_Arg (Arg2));
-                  begin
-                     Set_Parent (Temp, N);
-                     Preanalyze_And_Resolve (Temp, RTE (RE_Interrupt_ID));
-                  end;
+               declare
+                  Temp  : Node_Id;
+                  Typ   : Node_Id;
+                  Parg2 : constant Node_Id := Get_Pragma_Arg (Arg2);
 
-               else
-                  Analyze (Get_Pragma_Arg (Arg2));
-                  Resolve (Get_Pragma_Arg (Arg2), RTE (RE_Interrupt_ID));
-               end if;
+               begin
+                  --  In Relaxed_RM_Semantics mode, we allow any static
+                  --  integer value, for compatibility with other compilers.
+
+                  if Relaxed_RM_Semantics
+                    and then Nkind (Parg2) = N_Integer_Literal
+                  then
+                     Typ := Standard_Integer;
+                  else
+                     Typ := RTE (RE_Interrupt_ID);
+                  end if;
+
+                  if Expander_Active then
+                     Temp := New_Copy_Tree (Parg2);
+                     Set_Parent (Temp, N);
+                     Preanalyze_And_Resolve (Temp, Typ);
+                  else
+                     Analyze (Parg2);
+                     Resolve (Parg2, Typ);
+                  end if;
+               end;
 
                Process_Interrupt_Or_Attach_Handler;
             end if;
index 166948d37df60a0c7436274ce452642af1e69740..e6cacd854909aa934dfa5e79a5521f768e41cadb 100644 (file)
@@ -3345,7 +3345,7 @@ package VMS_Data is
    --                             qualifier with a value other than NONE (in
    --                             other words, this option is effective only
    --                             if optimization is turned on).
-
+   --
    --   ERRORS                    Warning messages are to be treated as errors.
    --                             The warning string still appears, but the
    --                             warning messages are counted as errors, and
@@ -3389,7 +3389,7 @@ package VMS_Data is
    --                           access to an atomic variable requires the
    --                           generation of atomic synchronization code.
    --
-   --   AVOID_GAPS              Activate warnings for gaps in records.
+   --   AVOIDGAPS               Activate warnings for gaps in records.
    --   (-gnatw.h)              This outputs a warning if a representation
    --                           clause for a record leaves unallocated bits.
    --
@@ -3408,6 +3408,10 @@ package VMS_Data is
    --   (-gnatwc)               in tests where the expression is known to
    --                           be True or False at compile time.
    --
+   --   CONSTANT_VARIABLES      Activate warnings on constant variables.
+   --   (-gnatwk)               A warning is output for a variable which could
+   --                           have been declared as a constant.
+   --
    --   DELETED_CODE            Activate warning for conditional deleted code.
    --   (-gnatwt)               This option generates warnings for tracking of
    --                           code in conditionals (IF and CASE statements)
@@ -3416,10 +3420,6 @@ package VMS_Data is
    --                           front end. This may be useful for detecting
    --                           deactivated code in certified applications.
    --
-   --   CONSTANT_VARIABLES      Activate warnings on constant variables.
-   --   (-gnatwk)               A warning is output for a variable which could
-   --                           have been declared as a constant.
-   --
    --   ELABORATION             Activate warnings on missing pragma Elaborate
    --   (-gnatwl)               and Elaborate_All statements.
    --
@@ -3433,15 +3433,6 @@ package VMS_Data is
    --                           an entity with the same name as some other
    --                           entity that is directly or use-visible.
    --
-   --   IMPORT_EXPORT_PRAGMAS   Activate warnings on import-export pragmas.
-   --   (-gnatwx)               This generates a warning on an Export or Import
-   --                           pragma when the compiler detects a possible
-   --                           conflict between the Ada and foreign language
-   --                           calling sequences. For example, the use of
-   --                           default parameters in a convention C procedure
-   --                           is dubious because the C compiler cannot supply
-   --                           the proper default, so a warning is issued.
-   --
    --   IMPLEMENTATION          Activate warnings for a with of an internal
    --   (-gnatwi)               GNAT implementation unit, defined as any unit
    --                           from the Ada, Interfaces, GNAT, DEC or System
@@ -3461,6 +3452,15 @@ package VMS_Data is
    --                           checks occur only at points where the source
    --                           program contains an explicit use of .all.
    --
+   --   IMPORT_EXPORT_PRAGMAS   Activate warnings on import-export pragmas.
+   --   (-gnatwx)               This generates a warning on an Export or Import
+   --                           pragma when the compiler detects a possible
+   --                           conflict between the Ada and foreign language
+   --                           calling sequences. For example, the use of
+   --                           default parameters in a convention C procedure
+   --                           is dubious because the C compiler cannot supply
+   --                           the proper default, so a warning is issued.
+   --
    --   INEFFECTIVE_INLINE      Activate warnings on ineffective Inlines.
    --   (-gnatwp)               Activates warnings for failure of front end
    --                           inlining (activated by /INLINE=FULL) to