[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 4 Aug 2014 10:54:14 +0000 (12:54 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 4 Aug 2014 10:54:14 +0000 (12:54 +0200)
2014-08-04  Eric Botcazou  <ebotcazou@adacore.com>

        * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Component>: Deal with
        renaming discriminants in tagged types first.
        * gcc-interface/trans.c (gnat_to_gnu) <N_Selected_Component>: Test
        the underlying type of the prefix.
        (Pragma_to_gnu, case Pragma_Warning): Ignore Reason => "..."
        (process_freeze_entity): Reset the nodes of
        all the view of a type, if any.

2014-08-04  Doug Rupp  <rupp@adacore.com>
    Olivier Hainque  <hainque@adacore.com>

        * gcc-interface/Makefile.in (x86 VxWorks): Add filter-out for vxworks7
and remove incorrect EH_MECHANISM macros.
        Add sigtramp.h to EXTRA_LIBGNAT_SRCS when we add sigtramp-vxworks.o to
EXTRA_LIBGNAT_OBJS.

From-SVN: r213569

gcc/ada/ChangeLog
gcc/ada/gcc-interface/Makefile.in
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/trans.c

index ea25404364776e796693f7bd802ddac41a8ea3b3..affb324903bf1a2c25e2f2fada4c849b365ed244 100644 (file)
@@ -1,3 +1,21 @@
+2014-08-04  Eric Botcazou  <ebotcazou@adacore.com>
+
+        * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Component>: Deal with
+        renaming discriminants in tagged types first.
+        * gcc-interface/trans.c (gnat_to_gnu) <N_Selected_Component>: Test
+        the underlying type of the prefix.
+        (Pragma_to_gnu, case Pragma_Warning): Ignore Reason => "..."
+        (process_freeze_entity): Reset the nodes of
+        all the view of a type, if any.
+
+2014-08-04  Doug Rupp  <rupp@adacore.com>
+           Olivier Hainque  <hainque@adacore.com>
+
+        * gcc-interface/Makefile.in (x86 VxWorks): Add filter-out for vxworks7
+       and remove incorrect EH_MECHANISM macros.
+        Add sigtramp.h to EXTRA_LIBGNAT_SRCS when we add sigtramp-vxworks.o to
+       EXTRA_LIBGNAT_OBJS.
+
 2014-08-04  Robert Dewar  <dewar@adacore.com>
 
        * exp_attr.adb (Expand_N_Attribute_Reference): Make sure prefix
index dddbf757c032236bf1f61f8296dc489452fe3db4..07d9828f775d07cb01cd81b7fee2b59ea244db2f 100644 (file)
@@ -451,8 +451,10 @@ LIB_VERSION = $(strip $(shell grep ' Library_Version :' $(fsrcpfx)ada/gnatvsn.ad
 
 # Additionnal object files from C source to be added to libgnat.
 EXTRA_LIBGNAT_OBJS=
-# Additionnal C source file to be added to libgnat without corresponding object
-# file (included files).
+
+# Additionnal C source files to be added to libgnat without corresponding
+# object file (#included files). This should include at least the GNAT
+# specific header files required to rebuild the runtime library from sources.
 EXTRA_LIBGNAT_SRCS=
 
 # GCC spec files to be installed in $(libsubdir), so --specs=<spec-filename>
@@ -588,6 +590,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(target_cpu) $(target_vendor) $
 
       EH_MECHANISM=-gcc
       EXTRA_LIBGNAT_OBJS+=affinity.o sigtramp-vxworks.o
+      EXTRA_LIBGNAT_SRCS+=sigtramp.h
     else
       ifeq ($(strip $(filter-out kernel-smp,$(THREAD_KIND))),)
         LIBGNAT_TARGET_PAIRS += \
@@ -618,6 +621,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(target_cpu) $(target_vendor) $
       endif
       EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
       EXTRA_LIBGNAT_OBJS+=sigtramp-vxworks.o
+      EXTRA_LIBGNAT_SRCS+=sigtramp.h
     endif
   endif
 
@@ -672,6 +676,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(target_cpu) $(target_vendor)
   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
 
   EXTRA_LIBGNAT_OBJS+=sigtramp-vxworks.o
+  EXTRA_LIBGNAT_SRCS+=sigtramp.h
 
   # Extra pairs for the vthreads runtime
   ifeq ($(strip $(filter-out vthreads,$(THREAD_KIND))),)
@@ -736,6 +741,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworksmils,$(target_cpu) $(target_vendo
   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
 
   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o sigtramp-vxworks.o
+  EXTRA_LIBGNAT_SRCS+=sigtramp.h
   GNATRTL_SOCKETS_OBJS =
 
   ifeq ($(strip $(filter-out yes,$(TRACE))),)
@@ -864,7 +870,7 @@ ifeq ($(strip $(filter-out sparc% wrs vx%,$(target_cpu) $(target_vendor) $(targe
 endif
 
 # x86 VxWorks
-ifeq ($(strip $(filter-out %86 wrs vxworks,$(target_cpu) $(target_vendor) $(target_os))),)
+ifeq ($(strip $(filter-out %86 wrs vxworks vxworks7,$(target_cpu) $(target_vendor) $(target_os))),)
   LIBGNAT_TARGET_PAIRS = \
   a-intnam.ads<a-intnam-vxworks.ads \
   i-vxwork.ads<i-vxwork-x86.ads \
@@ -920,8 +926,6 @@ ifeq ($(strip $(filter-out %86 wrs vxworks,$(target_cpu) $(target_vendor) $(targ
       EXTRA_LIBGNAT_OBJS+=affinity.o
     else
       ifeq ($(strip $(filter-out kernel-smp, $(THREAD_KIND))),)
-        EH_MECHANISM=-gcc
-
         LIBGNAT_TARGET_PAIRS += \
         s-interr.adb<s-interr-hwint.adb \
         s-mudido.adb<s-mudido-affinity.adb \
@@ -936,8 +940,6 @@ ifeq ($(strip $(filter-out %86 wrs vxworks,$(target_cpu) $(target_vendor) $(targ
         s-tpopsp.adb<s-tpopsp-vxworks.adb
 
         ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
-          EH_MECHANISM=-gcc
-
           LIBGNAT_TARGET_PAIRS += \
           s-vxwext.ads<s-vxwext-kernel.ads \
           s-vxwext.adb<s-vxwext-kernel.adb \
@@ -995,6 +997,7 @@ ifeq ($(strip $(filter-out arm% coff wrs vx%,$(target_cpu) $(target_vendor) $(ta
     system.ads<system-vxworks-arm-rtp.ads
 
     EXTRA_LIBGNAT_OBJS+=affinity.o sigtramp-vxworks.o
+    EXTRA_LIBGNAT_SRCS+=sigtramp.h
   else
     ifeq ($(strip $(filter-out kernel-smp,$(THREAD_KIND))),)
       EH_MECHANISM=-gcc
@@ -1007,6 +1010,7 @@ ifeq ($(strip $(filter-out arm% coff wrs vx%,$(target_cpu) $(target_vendor) $(ta
       system.ads<system-vxworks-arm.ads
 
       EXTRA_LIBGNAT_OBJS+=affinity.o sigtramp-vxworks.o
+      EXTRA_LIBGNAT_SRCS+=sigtramp.h
     else
       LIBGNAT_TARGET_PAIRS += \
       s-tpopsp.adb<s-tpopsp-vxworks.adb \
@@ -1020,6 +1024,7 @@ ifeq ($(strip $(filter-out arm% coff wrs vx%,$(target_cpu) $(target_vendor) $(ta
         s-vxwext.adb<s-vxwext-kernel.adb
 
         EXTRA_LIBGNAT_OBJS+=sigtramp-vxworks.o
+        EXTRA_LIBGNAT_SRCS+=sigtramp.h
       endif
     endif
   endif
index 1e390ef59bd77f754cd2e758855f31dfec8c3491..8e3db64392e18aa1dafe43e6f4e08b33afe49301 100644 (file)
@@ -497,33 +497,28 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
        /* The GNAT record where the component was defined.  */
        Entity_Id gnat_record = Underlying_Type (Scope (gnat_entity));
 
-       /* If the entity is an inherited component (in the case of extended
-          tagged record types), just return the original entity, which must
-          be a FIELD_DECL.  Likewise for discriminants.  If the entity is a
-          non-girder discriminant (in the case of derived untagged record
-          types), return the stored discriminant it renames.  */
-       if (Present (Original_Record_Component (gnat_entity))
-           && Original_Record_Component (gnat_entity) != gnat_entity)
+       /* If the entity is a discriminant of an extended tagged type used to
+          rename a discriminant of the parent type, return the latter.  */
+       if (Is_Tagged_Type (gnat_record)
+           && Present (Corresponding_Discriminant (gnat_entity)))
          {
            gnu_decl
-             = gnat_to_gnu_entity (Original_Record_Component (gnat_entity),
+             = gnat_to_gnu_entity (Corresponding_Discriminant (gnat_entity),
                                    gnu_expr, definition);
            saved = true;
            break;
          }
 
-       /* If this is a discriminant of an extended tagged type used to rename
-          a discriminant of the parent type, return the latter.  */
-       else if (Present (Corresponding_Discriminant (gnat_entity)))
+       /* If the entity is an inherited component (in the case of extended
+          tagged record types), just return the original entity, which must
+          be a FIELD_DECL.  Likewise for discriminants.  If the entity is a
+          non-girder discriminant (in the case of derived untagged record
+          types), return the stored discriminant it renames.  */
+       else if (Present (Original_Record_Component (gnat_entity))
+                && Original_Record_Component (gnat_entity) != gnat_entity)
          {
-           /* If the derived type is untagged, then this is a non-girder
-              discriminant and its Original_Record_Component must point to
-              the stored discriminant it renames (i.e. we should have taken
-              the previous branch).  */
-           gcc_assert (Is_Tagged_Type (gnat_record));
-
            gnu_decl
-             = gnat_to_gnu_entity (Corresponding_Discriminant (gnat_entity),
+             = gnat_to_gnu_entity (Original_Record_Component (gnat_entity),
                                    gnu_expr, definition);
            saved = true;
            break;
@@ -2184,7 +2179,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
        for (index = ndim - 1; index >= 0; index--)
          {
            tem = build_nonshared_array_type (tem, gnu_index_types[index]);
-           if (Reverse_Storage_Order (gnat_entity))
+           if (Reverse_Storage_Order (gnat_entity) && !GNAT_Mode)
              sorry ("non-default Scalar_Storage_Order");
            TYPE_MULTI_ARRAY_P (tem) = (index > 0);
            if (array_type_has_nonaliased_component (tem, gnat_entity))
@@ -2916,7 +2911,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
        gnu_type = make_node (tree_code_for_record_type (gnat_entity));
        TYPE_NAME (gnu_type) = gnu_entity_name;
        TYPE_PACKED (gnu_type) = (packed != 0) || has_rep;
-
        if (Reverse_Storage_Order (gnat_entity) && !GNAT_Mode)
          sorry ("non-default Scalar_Storage_Order");
        process_attributes (&gnu_type, &attr_list, true, gnat_entity);
index 77a8f87f2d1a962c256aec334945efff074d3994..8117ee8f5462debb245c2a0e30ce12854bc7e5cc 100644 (file)
@@ -1417,7 +1417,8 @@ Pragma_to_gnu (Node_Id gnat_node)
                  gcc_unreachable ();
              }
 
-           if (Present (Next (gnat_temp)))
+           /* Deal with optional pattern (but ignore Reason => "...").  */
+           if (Present (Next (gnat_temp)) && No (Chars (Next (gnat_temp))))
              {
                /* pragma Warnings (On | Off, Name) is handled differently.  */
                if (Nkind (Expression (Next (gnat_temp))) != N_String_Literal)
@@ -5767,7 +5768,7 @@ gnat_to_gnu (Node_Id gnat_node)
 
        /* For discriminant references in tagged types always substitute the
           corresponding discriminant as the actual selected component.  */
-       if (Is_Tagged_Type (Etype (gnat_prefix)))
+       if (Is_Tagged_Type (Underlying_Type (Etype (gnat_prefix))))
          while (Present (Corresponding_Discriminant (gnat_field)))
            gnat_field = Corresponding_Discriminant (gnat_field);
 
@@ -7910,12 +7911,14 @@ process_freeze_entity (Node_Id gnat_node)
        {
          Entity_Id full_view = Full_View (gnat_entity);
 
+         save_gnu_tree (full_view, NULL_TREE, false);
+
           if (IN (Ekind (full_view), Private_Kind)
              && Present (Underlying_Full_View (full_view)))
-           full_view = Underlying_Full_View (full_view);
-
-         if (present_gnu_tree (full_view))
-           save_gnu_tree (full_view, NULL_TREE, false);
+           {
+             full_view = Underlying_Full_View (full_view);
+             save_gnu_tree (full_view, NULL_TREE, false);
+           }
        }
 
       if (IN (kind, Type_Kind)