]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sinfo.ads: Documentation update.
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 24 Jan 2014 15:00:26 +0000 (16:00 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 24 Jan 2014 15:00:26 +0000 (16:00 +0100)
2014-01-24  Ed Schonberg  <schonberg@adacore.com>

* sinfo.ads: Documentation update.

2014-01-24  Ed Schonberg  <schonberg@adacore.com>

* sem_ch3.adb (Constant_Redeclaration): New declaration is
illegal if previous one has an initial expression that is an
aggregate expanded into assignments.

2014-01-24  Ed Schonberg  <schonberg@adacore.com>

* sem_ch5.adb (Analyze_Loop_Parameter_Specification): Small
code reorganization to remove spurious warning on a loop with
an array element iterator that has a null range.

From-SVN: r207041

gcc/ada/ChangeLog
gcc/ada/sem_ch3.adb
gcc/ada/sem_ch5.adb
gcc/ada/sinfo.ads

index 41a0ed0ec60d82d24de798bdafc36723b1dfb8fa..59072a6e5633fa50ccbfe5d2af44729d4a404534 100644 (file)
@@ -1,3 +1,35 @@
+2014-01-24  Ed Schonberg  <schonberg@adacore.com>
+
+       * sinfo.ads: Documentation update.
+
+2014-01-24  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch3.adb (Constant_Redeclaration): New declaration is
+       illegal if previous one has an initial expression that is an
+       aggregate expanded into assignments.
+
+2014-01-24  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch5.adb (Analyze_Loop_Parameter_Specification): Small
+       code reorganization to remove spurious warning on a loop with
+       an array element iterator that has a null range.
+
+2014-01-24  Vincent Celier  <celier@adacore.com>
+
+       * make.adb (Binding_Phase): When setting the Ada paths, use
+       the library ALI dir, not the object dir in libraries.
+
+2014-01-24  Yannick Moy  <moy@adacore.com>
+
+       * sinfo.ads: Add documentation of check flag fields.
+
+2014-01-24  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_res.adb (Resolve_Actuals): If an actual is a view
+       conversion of a discriminated object, and the formal type is
+       discriminated and constrained, apply a discriminant check to
+       the object itself.
+
 2014-01-24  Robert Dewar  <dewar@adacore.com>
 
        * prj.adb, prj-env.adb, back_end.adb: Add comment, minor code clean ups.
index cdfc062a5db31915a111dd4e9a8db9961cbd4bfe..014105bedb5b866229cb949675cc18b51a3ffaca 100644 (file)
@@ -11104,10 +11104,13 @@ package body Sem_Ch3 is
       --  If previous full declaration or a renaming declaration exists, or if
       --  a homograph is present, let Enter_Name handle it, either with an
       --  error or with the removal of an overridden implicit subprogram.
+      --  The previous one is a full declaration if it has an expression
+      --  (which in the case of an aggregate is indicated by the Init flag).
 
       if Ekind (Prev) /= E_Constant
         or else Nkind (Parent (Prev)) = N_Object_Renaming_Declaration
         or else Present (Expression (Parent (Prev)))
+        or else Has_Init_Expression (Parent (Prev))
         or else Present (Full_View (Prev))
       then
          Enter_Name (Id);
index a5be2903819515e4b955f1d241f5c9c37e8ca3de..1d647094288ee27b7d3a881bb4a82e2032c4c4b4 100644 (file)
@@ -2457,9 +2457,11 @@ package body Sem_Ch5 is
 
       --  Check for null or possibly null range and issue warning. We suppress
       --  such messages in generic templates and instances, because in practice
-      --  they tend to be dubious in these cases.
+      --  they tend to be dubious in these cases. The check applies as well to
+      --  rewritten array element loops where a null range may be detected
+      --  statically.
 
-      if Nkind (DS) = N_Range and then Comes_From_Source (N) then
+      if Nkind (DS) = N_Range then
          declare
             L : constant Node_Id := Low_Bound  (DS);
             H : constant Node_Id := High_Bound (DS);
@@ -2481,21 +2483,23 @@ package body Sem_Ch5 is
                   if Compile_Time_Compare
                        (L, H, Assume_Valid => False) = GT
                   then
-                     Error_Msg_N
-                       ("??loop range is null, loop will not execute", DS);
-
                      --  Since we know the range of the loop is null, set the
                      --  appropriate flag to remove the loop entirely during
                      --  expansion.
 
                      Set_Is_Null_Loop (Loop_Nod);
 
-                  --  Here is where the loop could execute because of invalid
-                  --  values, so issue appropriate message and in this case we
-                  --  do not set the Is_Null_Loop flag since the loop may
-                  --  execute.
+                     if Comes_From_Source (N) then
+                        Error_Msg_N
+                          ("??loop range is null, loop will not execute", DS);
+                     end if;
 
-                  else
+                     --  Here is where the loop could execute because of
+                     --  invalid values, so issue appropriate message and in
+                     --  this case we do not set the Is_Null_Loop flag since
+                     --  the loop may execute.
+
+                  elsif Comes_From_Source (N) then
                      Error_Msg_N
                        ("??loop range may be null, loop may not execute",
                         DS);
index cc11f4ff8e6e15130534543c130cf7a980961e05..f71fdd0a0ae60e5f8dc7a73353f6c2d5b4ca0800 100644 (file)
@@ -516,12 +516,12 @@ package Sinfo is
    --  expansion is performed and the analysis must generate a tree in a
    --  form that meets additional requirements.
 
-   --  This light expansion does two transformations of the tree, that cannot
-   --  be postponed after the frontend semantic analysis:
+   --  This light expansion does two transformations of the tree that cannot
+   --  be postponed after semantic analysis:
 
    --    1. Replace object renamings by renamed object. This requires the
-   --       introdtion of temporaries at the point of the renaming, which must
-   --       be properly analyzed.
+   --       introduction of temporaries at the point of the renaming, which
+   --       must be properly analyzed.
 
    --    2. Fully qualify entity names. This is needed to generate suitable
    --       local effects and call-graphs in ALI files, with the completely
@@ -549,6 +549,39 @@ package Sinfo is
    --  not make sense from a user point-of-view, and that cross-references that
    --  do not lead to data dependences for subprograms can be safely ignored.
 
+   -----------------------
+   -- Check Flag Fields --
+   -----------------------
+
+   --  The following flag fields appear in expression nodes:
+
+   --  Do_Division_Check
+   --  Do_Overflow_Check
+   --  Do_Range_Check
+
+   --  These three flags are always set by the front end during semantic
+   --  analysis, on expression nodes that may trigger the corresponding
+   --  check. The front end then inserts or not the check during expansion.
+   --  In particular, these flags should also be correctly set in ASIS mode
+   --  and GNATprove mode.
+
+   --  Note that this accounts for all nodes that trigger the corresponding
+   --  checks, except for range checks on subtype_indications, which may be
+   --  required to check that a range_constraint is compatible with the given
+   --  subtype (RM 3.2.2(11)).
+
+   --  The following flag fields appear in various nodes:
+
+   --  Do_Accessibility_Check
+   --  Do_Discriminant_Check
+   --  Do_Length_Check
+   --  Do_Storage_Check
+   --  Do_Tag_Check
+
+   --  These flags are used in some specific cases by the front end, either
+   --  during semantic analysis or during expansion, and cannot be expected
+   --  to be set on all nodes that trigger the corresponding check.
+
    ------------------------
    -- Common Flag Fields --
    ------------------------
@@ -2430,12 +2463,14 @@ package Sinfo is
       --  Etype (Node5-Sem)
       --  Must_Not_Freeze (Flag8-Sem)
 
-      --  Note: Etype is a copy of the Etype field of the Subtype_Mark. The
-      --  reason for this redundancy is so that in a list of array index types,
-      --  the Etype can be uniformly accessed to determine the subscript type.
-      --  This means that no Itype is constructed for the actual subtype that
-      --  is created by the subtype indication. If such an Itype is required,
-      --  it is constructed in the context in which the indication appears.
+      --  Note: Depending on context, the Etype is either the entity of the
+      --  Subtype_Mark field, or it is an itype constructed to reify the
+      --  subtype indication. In particular, such itypes are created for a
+      --  subtype indication that appears in an array type declaration. This
+      --  simplifies constraint checking in indexed components.
+
+      --  For subtype indications that appear in scalar type and subtype
+      --  declarations, the Etype is the entity of the subtype mark.
 
       -------------------------
       -- 3.2.2  Subtype Mark --
@@ -7325,7 +7360,7 @@ package Sinfo is
       --  N_Expression_With_Actions has type Standard_Void_Type. However some
       --  backends do not support such expression-with-actions occurring
       --  outside of a proper (non-void) expression, so this should just be
-      --  used as an intermediate representation within the front-end. Also
+      --  used as an intermediate representation within the front end. Also
       --  note that this is really an irregularity (expressions and statements
       --  are not interchangeable, and in particular an N_Null_Statement is
       --  not a proper expression), and in the long term all cases of this
@@ -7746,7 +7781,7 @@ package Sinfo is
       --  e.g. involving unconstrained array types.
 
       --  For the case of the standard gigi backend, this means that all
-      --  checks are done in the front-end.
+      --  checks are done in the front end.
 
       --  However, in the case of specialized back-ends, notably the JVM
       --  backend for JGNAT, additional requirements and restrictions apply