[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 8 Sep 2017 09:15:24 +0000 (11:15 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 8 Sep 2017 09:15:24 +0000 (11:15 +0200)
2017-09-08  Bob Duff  <duff@adacore.com>

* sem_ch3.adb (Build_Derived_Private_Type): Inherit
representation items from interfaces that the derived type
implements, not just from the parent type.
* sem_util.ads, sem_util.adb (Abstract_Interface_List): Change
this to return an empty list when there are no interfaces.
* einfo.ads, sem_ch13.adb: Minor comment fixes.
* sem_attr.adb: Minor comment fix.

2017-09-08  Doug Rupp  <rupp@adacore.com>

* sigtramp-vxworks.c [i386]: Adjust the kernel context for
x86-vx7.

2017-09-08  Hristian Kirtchev  <kirtchev@adacore.com>

* exp_ch4.adb (Expand_N_Allocator): Generate a
call to Allocate_Any_Controlled when the allocation does not
require any initialization.

From-SVN: r251870

gcc/ada/ChangeLog
gcc/ada/einfo.ads
gcc/ada/exp_ch4.adb
gcc/ada/sem_attr.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads
gcc/ada/sigtramp-vxworks.c

index e4501ea..2631caf 100644 (file)
@@ -1,3 +1,24 @@
+2017-09-08  Bob Duff  <duff@adacore.com>
+
+       * sem_ch3.adb (Build_Derived_Private_Type): Inherit
+       representation items from interfaces that the derived type
+       implements, not just from the parent type.
+       * sem_util.ads, sem_util.adb (Abstract_Interface_List): Change
+       this to return an empty list when there are no interfaces.
+       * einfo.ads, sem_ch13.adb: Minor comment fixes.
+       * sem_attr.adb: Minor comment fix.
+
+2017-09-08  Doug Rupp  <rupp@adacore.com>
+
+       * sigtramp-vxworks.c [i386]: Adjust the kernel context for
+       x86-vx7.
+
+2017-09-08  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * exp_ch4.adb (Expand_N_Allocator): Generate a
+       call to Allocate_Any_Controlled when the allocation does not
+       require any initialization.
+
 2017-09-08  Hristian Kirtchev  <kirtchev@adacore.com>
 
        * sem_util.adb (Copy_Node_With_Replacement):
index e83c1c4..2270556 100644 (file)
@@ -2730,8 +2730,8 @@ package Einfo is
 
 --    Is_Interface (Flag186)
 --       Defined in record types and subtypes. Set to indicate that the current
---       entity corresponds with an abstract interface. Because abstract
---       interfaces are conceptually a special kind of abstract tagged types
+--       entity corresponds to an abstract interface. Because abstract
+--       interfaces are conceptually a special kind of abstract tagged type
 --       we represent them by means of tagged record types and subtypes
 --       marked with this attribute. This allows us to reuse most of the
 --       compiler support for abstract tagged types to implement interfaces
index ce87837..e2e58c9 100644 (file)
@@ -4632,7 +4632,9 @@ package body Exp_Ch4 is
             --  No initialization required
 
             else
-               null;
+               Build_Allocate_Deallocate_Proc
+                 (N           => N,
+                  Is_Allocate => True);
             end if;
 
          --  Case of initialization procedure present, must be called
index 09ca1fd..641ac87 100644 (file)
@@ -8199,7 +8199,8 @@ package body Sem_Attr is
 
       case Id is
 
-      --  Attributes related to Ada 2012 iterators (placeholder ???)
+      --  Attributes related to Ada 2012 iterators; nothing to evaluate for
+      --  these.
 
       when Attribute_Constant_Indexing
          | Attribute_Default_Iterator
index 9b97f8f..dea044a 100644 (file)
@@ -3974,7 +3974,7 @@ package body Sem_Ch13 is
 
       procedure Check_Iterator_Functions;
       --  Check that there is a single function in Default_Iterator attribute
-      --  has the proper type structure.
+      --  that has the proper type structure.
 
       function Check_Primitive_Function (Subp : Entity_Id) return Boolean;
       --  Common legality check for the previous two
index 41bf2a8..158aa67 100644 (file)
@@ -9576,9 +9576,18 @@ package body Sem_Ch3 is
          Set_Has_Predicates (Derived_Type);
       end if;
 
-      --  The derived type inherits the representation clauses of the parent
+      --  The derived type inherits representation clauses from the parent
+      --  type, and from any interfaces.
 
       Inherit_Rep_Item_Chain (Derived_Type, Parent_Type);
+      declare
+         Iface : Node_Id := First (Abstract_Interface_List (Derived_Type));
+      begin
+         while Present (Iface) loop
+            Inherit_Rep_Item_Chain (Derived_Type, Entity (Iface));
+            Next (Iface);
+         end loop;
+      end;
 
       --  If the parent type has delayed rep aspects, then mark the derived
       --  type as possibly inheriting a delayed rep aspect.
index f57b7c5..9deee3b 100644 (file)
@@ -198,12 +198,17 @@ package body Sem_Util is
 
          return Abstract_Interface_List (Etype (Typ));
 
-      else pragma Assert ((Ekind (Typ)) = E_Record_Type);
+      elsif Ekind (Typ) = E_Record_Type then
          if Nkind (Parent (Typ)) = N_Formal_Type_Declaration then
             Nod := Formal_Type_Definition (Parent (Typ));
          else
             Nod := Type_Definition (Parent (Typ));
          end if;
+
+      --  It's not the kind of type that can implement interfaces
+
+      else
+         return Empty_List;
       end if;
 
       return Interface_List (Nod);
index 58a362b..a7b3487 100644 (file)
@@ -37,8 +37,9 @@ with Urealp;  use Urealp;
 package Sem_Util is
 
    function Abstract_Interface_List (Typ : Entity_Id) return List_Id;
-   --  Given a type that implements interfaces look for its associated
-   --  definition node and return its list of interfaces.
+   --  The list of interfaces implemented by Typ. Empty if there are none,
+   --  including the cases where there can't be any because e.g. the type is
+   --  not tagged.
 
    procedure Add_Access_Type_To_Process (E : Entity_Id; A : Entity_Id);
    --  Add A to the list of access types to process when expanding the
index e9dd9aa..211be97 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                         Asm Implementation File                          *
  *                                                                          *
- *         Copyright (C) 2011-2015, Free Software Foundation, Inc.          *
+ *         Copyright (C) 2011-2017, Free Software Foundation, Inc.          *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
@@ -39,6 +39,9 @@
 #include <vxWorks.h>
 #include <arch/../regs.h>
 #ifndef __RTP__
+#if defined(__i386__)
+#include <version.h>
+#endif
 #include <sigLib.h>
 #else
 #include <signal.h>
@@ -127,11 +130,13 @@ void __gnat_sigtramp (int signo, void *si, void *sc,
        containing a complete REG_SET just before the field 'sc_pregs', this
        adds a 208 bytes offset to get the value of 'sc_pregs'.
      * on x86-vx7: the same offset is used on vx7: 3 32-bit values are present
-       at the enf of the reg set, but the padding is then of 0xc4 characters.
+       at the end of the reg set, but the padding is then of 0xc4 characters.
      * on x86_64-vx7: two 64-bit values are added at the beginning of the
        REG_SET. This adds a 16 bytes offset to get the value of 'sc_pregs',
        and another 16 bytes offset within the pregs structure to retrieve the
        registers list.
+
+     * See header file regsSimlinux.h.
   */
 
   /* Retrieve the registers to restore : */
@@ -141,7 +146,9 @@ void __gnat_sigtramp (int signo, void *si, void *sc,
   /* move sctx 208 bytes further, so that the vxsim's sc_pregs field coincide
      with the expected x86 one */
   struct sigcontext * sctx =
-    (struct sigcontext *) (sc + (__gnat_is_vxsim ? 208 : 0));
+    (struct sigcontext *) (sc + (__gnat_is_vxsim ?
+                                (_WRS_VXWORKS_MAJOR == 7 ? 204 : 208)
+                                : 0));
 #elif defined(__x86_64__)
   /* move sctx 16 bytes further, so that the vxsim's sc_pregs field coincide
      with the expected x86_64 one */