Commit f10ff6cc by Arnaud Charlet

[multiple changes]

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
parent 74014283
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> 2014-08-04 Robert Dewar <dewar@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference): Make sure prefix * exp_attr.adb (Expand_N_Attribute_Reference): Make sure prefix
......
...@@ -451,8 +451,10 @@ LIB_VERSION = $(strip $(shell grep ' Library_Version :' $(fsrcpfx)ada/gnatvsn.ad ...@@ -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. # Additionnal object files from C source to be added to libgnat.
EXTRA_LIBGNAT_OBJS= 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= EXTRA_LIBGNAT_SRCS=
# GCC spec files to be installed in $(libsubdir), so --specs=<spec-filename> # 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) $ ...@@ -588,6 +590,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(target_cpu) $(target_vendor) $
EH_MECHANISM=-gcc EH_MECHANISM=-gcc
EXTRA_LIBGNAT_OBJS+=affinity.o sigtramp-vxworks.o EXTRA_LIBGNAT_OBJS+=affinity.o sigtramp-vxworks.o
EXTRA_LIBGNAT_SRCS+=sigtramp.h
else else
ifeq ($(strip $(filter-out kernel-smp,$(THREAD_KIND))),) ifeq ($(strip $(filter-out kernel-smp,$(THREAD_KIND))),)
LIBGNAT_TARGET_PAIRS += \ LIBGNAT_TARGET_PAIRS += \
...@@ -618,6 +621,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(target_cpu) $(target_vendor) $ ...@@ -618,6 +621,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(target_cpu) $(target_vendor) $
endif endif
EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
EXTRA_LIBGNAT_OBJS+=sigtramp-vxworks.o EXTRA_LIBGNAT_OBJS+=sigtramp-vxworks.o
EXTRA_LIBGNAT_SRCS+=sigtramp.h
endif endif
endif endif
...@@ -672,6 +676,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(target_cpu) $(target_vendor) ...@@ -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_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
EXTRA_LIBGNAT_OBJS+=sigtramp-vxworks.o EXTRA_LIBGNAT_OBJS+=sigtramp-vxworks.o
EXTRA_LIBGNAT_SRCS+=sigtramp.h
# Extra pairs for the vthreads runtime # Extra pairs for the vthreads runtime
ifeq ($(strip $(filter-out vthreads,$(THREAD_KIND))),) ifeq ($(strip $(filter-out vthreads,$(THREAD_KIND))),)
...@@ -736,6 +741,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworksmils,$(target_cpu) $(target_vendo ...@@ -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_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
EXTRA_LIBGNAT_OBJS+=vx_stack_info.o sigtramp-vxworks.o EXTRA_LIBGNAT_OBJS+=vx_stack_info.o sigtramp-vxworks.o
EXTRA_LIBGNAT_SRCS+=sigtramp.h
GNATRTL_SOCKETS_OBJS = GNATRTL_SOCKETS_OBJS =
ifeq ($(strip $(filter-out yes,$(TRACE))),) ifeq ($(strip $(filter-out yes,$(TRACE))),)
...@@ -864,7 +870,7 @@ ifeq ($(strip $(filter-out sparc% wrs vx%,$(target_cpu) $(target_vendor) $(targe ...@@ -864,7 +870,7 @@ ifeq ($(strip $(filter-out sparc% wrs vx%,$(target_cpu) $(target_vendor) $(targe
endif endif
# x86 VxWorks # 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 = \ LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<a-intnam-vxworks.ads \ a-intnam.ads<a-intnam-vxworks.ads \
i-vxwork.ads<i-vxwork-x86.ads \ i-vxwork.ads<i-vxwork-x86.ads \
...@@ -920,8 +926,6 @@ ifeq ($(strip $(filter-out %86 wrs vxworks,$(target_cpu) $(target_vendor) $(targ ...@@ -920,8 +926,6 @@ ifeq ($(strip $(filter-out %86 wrs vxworks,$(target_cpu) $(target_vendor) $(targ
EXTRA_LIBGNAT_OBJS+=affinity.o EXTRA_LIBGNAT_OBJS+=affinity.o
else else
ifeq ($(strip $(filter-out kernel-smp, $(THREAD_KIND))),) ifeq ($(strip $(filter-out kernel-smp, $(THREAD_KIND))),)
EH_MECHANISM=-gcc
LIBGNAT_TARGET_PAIRS += \ LIBGNAT_TARGET_PAIRS += \
s-interr.adb<s-interr-hwint.adb \ s-interr.adb<s-interr-hwint.adb \
s-mudido.adb<s-mudido-affinity.adb \ s-mudido.adb<s-mudido-affinity.adb \
...@@ -936,8 +940,6 @@ ifeq ($(strip $(filter-out %86 wrs vxworks,$(target_cpu) $(target_vendor) $(targ ...@@ -936,8 +940,6 @@ ifeq ($(strip $(filter-out %86 wrs vxworks,$(target_cpu) $(target_vendor) $(targ
s-tpopsp.adb<s-tpopsp-vxworks.adb s-tpopsp.adb<s-tpopsp-vxworks.adb
ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),) ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
EH_MECHANISM=-gcc
LIBGNAT_TARGET_PAIRS += \ LIBGNAT_TARGET_PAIRS += \
s-vxwext.ads<s-vxwext-kernel.ads \ s-vxwext.ads<s-vxwext-kernel.ads \
s-vxwext.adb<s-vxwext-kernel.adb \ s-vxwext.adb<s-vxwext-kernel.adb \
...@@ -995,6 +997,7 @@ ifeq ($(strip $(filter-out arm% coff wrs vx%,$(target_cpu) $(target_vendor) $(ta ...@@ -995,6 +997,7 @@ ifeq ($(strip $(filter-out arm% coff wrs vx%,$(target_cpu) $(target_vendor) $(ta
system.ads<system-vxworks-arm-rtp.ads system.ads<system-vxworks-arm-rtp.ads
EXTRA_LIBGNAT_OBJS+=affinity.o sigtramp-vxworks.o EXTRA_LIBGNAT_OBJS+=affinity.o sigtramp-vxworks.o
EXTRA_LIBGNAT_SRCS+=sigtramp.h
else else
ifeq ($(strip $(filter-out kernel-smp,$(THREAD_KIND))),) ifeq ($(strip $(filter-out kernel-smp,$(THREAD_KIND))),)
EH_MECHANISM=-gcc EH_MECHANISM=-gcc
...@@ -1007,6 +1010,7 @@ ifeq ($(strip $(filter-out arm% coff wrs vx%,$(target_cpu) $(target_vendor) $(ta ...@@ -1007,6 +1010,7 @@ ifeq ($(strip $(filter-out arm% coff wrs vx%,$(target_cpu) $(target_vendor) $(ta
system.ads<system-vxworks-arm.ads system.ads<system-vxworks-arm.ads
EXTRA_LIBGNAT_OBJS+=affinity.o sigtramp-vxworks.o EXTRA_LIBGNAT_OBJS+=affinity.o sigtramp-vxworks.o
EXTRA_LIBGNAT_SRCS+=sigtramp.h
else else
LIBGNAT_TARGET_PAIRS += \ LIBGNAT_TARGET_PAIRS += \
s-tpopsp.adb<s-tpopsp-vxworks.adb \ s-tpopsp.adb<s-tpopsp-vxworks.adb \
...@@ -1020,6 +1024,7 @@ ifeq ($(strip $(filter-out arm% coff wrs vx%,$(target_cpu) $(target_vendor) $(ta ...@@ -1020,6 +1024,7 @@ ifeq ($(strip $(filter-out arm% coff wrs vx%,$(target_cpu) $(target_vendor) $(ta
s-vxwext.adb<s-vxwext-kernel.adb s-vxwext.adb<s-vxwext-kernel.adb
EXTRA_LIBGNAT_OBJS+=sigtramp-vxworks.o EXTRA_LIBGNAT_OBJS+=sigtramp-vxworks.o
EXTRA_LIBGNAT_SRCS+=sigtramp.h
endif endif
endif endif
endif endif
......
...@@ -497,33 +497,28 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -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. */ /* The GNAT record where the component was defined. */
Entity_Id gnat_record = Underlying_Type (Scope (gnat_entity)); Entity_Id gnat_record = Underlying_Type (Scope (gnat_entity));
/* If the entity is an inherited component (in the case of extended /* If the entity is a discriminant of an extended tagged type used to
tagged record types), just return the original entity, which must rename a discriminant of the parent type, return the latter. */
be a FIELD_DECL. Likewise for discriminants. If the entity is a if (Is_Tagged_Type (gnat_record)
non-girder discriminant (in the case of derived untagged record && Present (Corresponding_Discriminant (gnat_entity)))
types), return the stored discriminant it renames. */
if (Present (Original_Record_Component (gnat_entity))
&& Original_Record_Component (gnat_entity) != gnat_entity)
{ {
gnu_decl gnu_decl
= gnat_to_gnu_entity (Original_Record_Component (gnat_entity), = gnat_to_gnu_entity (Corresponding_Discriminant (gnat_entity),
gnu_expr, definition); gnu_expr, definition);
saved = true; saved = true;
break; break;
} }
/* If this is a discriminant of an extended tagged type used to rename /* If the entity is an inherited component (in the case of extended
a discriminant of the parent type, return the latter. */ tagged record types), just return the original entity, which must
else if (Present (Corresponding_Discriminant (gnat_entity))) 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 gnu_decl
= gnat_to_gnu_entity (Corresponding_Discriminant (gnat_entity), = gnat_to_gnu_entity (Original_Record_Component (gnat_entity),
gnu_expr, definition); gnu_expr, definition);
saved = true; saved = true;
break; break;
...@@ -2184,7 +2179,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -2184,7 +2179,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
for (index = ndim - 1; index >= 0; index--) for (index = ndim - 1; index >= 0; index--)
{ {
tem = build_nonshared_array_type (tem, gnu_index_types[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"); sorry ("non-default Scalar_Storage_Order");
TYPE_MULTI_ARRAY_P (tem) = (index > 0); TYPE_MULTI_ARRAY_P (tem) = (index > 0);
if (array_type_has_nonaliased_component (tem, gnat_entity)) 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) ...@@ -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)); gnu_type = make_node (tree_code_for_record_type (gnat_entity));
TYPE_NAME (gnu_type) = gnu_entity_name; TYPE_NAME (gnu_type) = gnu_entity_name;
TYPE_PACKED (gnu_type) = (packed != 0) || has_rep; TYPE_PACKED (gnu_type) = (packed != 0) || has_rep;
if (Reverse_Storage_Order (gnat_entity) && !GNAT_Mode) if (Reverse_Storage_Order (gnat_entity) && !GNAT_Mode)
sorry ("non-default Scalar_Storage_Order"); sorry ("non-default Scalar_Storage_Order");
process_attributes (&gnu_type, &attr_list, true, gnat_entity); process_attributes (&gnu_type, &attr_list, true, gnat_entity);
......
...@@ -1417,7 +1417,8 @@ Pragma_to_gnu (Node_Id gnat_node) ...@@ -1417,7 +1417,8 @@ Pragma_to_gnu (Node_Id gnat_node)
gcc_unreachable (); 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. */ /* pragma Warnings (On | Off, Name) is handled differently. */
if (Nkind (Expression (Next (gnat_temp))) != N_String_Literal) if (Nkind (Expression (Next (gnat_temp))) != N_String_Literal)
...@@ -5767,7 +5768,7 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -5767,7 +5768,7 @@ gnat_to_gnu (Node_Id gnat_node)
/* For discriminant references in tagged types always substitute the /* For discriminant references in tagged types always substitute the
corresponding discriminant as the actual selected component. */ 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))) while (Present (Corresponding_Discriminant (gnat_field)))
gnat_field = Corresponding_Discriminant (gnat_field); gnat_field = Corresponding_Discriminant (gnat_field);
...@@ -7910,12 +7911,14 @@ process_freeze_entity (Node_Id gnat_node) ...@@ -7910,12 +7911,14 @@ process_freeze_entity (Node_Id gnat_node)
{ {
Entity_Id full_view = Full_View (gnat_entity); Entity_Id full_view = Full_View (gnat_entity);
save_gnu_tree (full_view, NULL_TREE, false);
if (IN (Ekind (full_view), Private_Kind) if (IN (Ekind (full_view), Private_Kind)
&& Present (Underlying_Full_View (full_view))) && Present (Underlying_Full_View (full_view)))
full_view = 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);
save_gnu_tree (full_view, NULL_TREE, false); }
} }
if (IN (kind, Type_Kind) if (IN (kind, Type_Kind)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment