summaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-20 10:59:26 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-20 10:59:26 +0000
commitde6194016356223706cbd2a3d8f2a712696f191b (patch)
tree853a13747cde23451982d1083de9ba5cd2aac839 /gcc/ada/gcc-interface/decl.c
parent874167105a1406a4ac265157cf2a8d11ca65b553 (diff)
downloadgcc-de6194016356223706cbd2a3d8f2a712696f191b.tar.gz
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Robustify tests
for aliased objects with an unconstrained nominal subtype. * gcc-interface/trans.c (Call_to_gnu): Likewise. (gnat_to_gnu) <case N_Op_Not>: Robustify test for private type. <case N_Op_Minus>: Remove useless code. (Exception_Handler_to_gnu_zcx): Minor tweaks. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206798 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index dd912f37c97..5259ad4297a 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -771,8 +771,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|| (TYPE_SIZE (gnu_type)
&& integer_zerop (TYPE_SIZE (gnu_type))
&& !TREE_OVERFLOW (TYPE_SIZE (gnu_type))))
- && (!Is_Constr_Subt_For_UN_Aliased (Etype (gnat_entity))
- || !Is_Array_Type (Etype (gnat_entity)))
+ && !Is_Constr_Subt_For_UN_Aliased (Etype (gnat_entity))
&& No (Renamed_Object (gnat_entity))
&& No (Address_Clause (gnat_entity)))
gnu_size = bitsize_unit_node;
@@ -864,7 +863,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* If this is an aliased object with an unconstrained nominal subtype,
make a type that includes the template. */
if (Is_Constr_Subt_For_UN_Aliased (Etype (gnat_entity))
- && Is_Array_Type (Etype (gnat_entity))
+ && (Is_Array_Type (Etype (gnat_entity))
+ || (Is_Private_Type (Etype (gnat_entity))
+ && Is_Array_Type (Full_View (Etype (gnat_entity)))))
&& !type_annotate_only)
{
tree gnu_array
@@ -1390,7 +1391,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
Note that we have to do that this late because of the couple of
allocation adjustments that might be made just above. */
if (Is_Constr_Subt_For_UN_Aliased (Etype (gnat_entity))
- && Is_Array_Type (Etype (gnat_entity))
+ && (Is_Array_Type (Etype (gnat_entity))
+ || (Is_Private_Type (Etype (gnat_entity))
+ && Is_Array_Type (Full_View (Etype (gnat_entity)))))
&& !type_annotate_only)
{
tree gnu_array
@@ -4788,10 +4791,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
from the full view. But always get the type from the full view
for define on use types, since otherwise we won't see them! */
else if (!definition
- || (Is_Itype (full_view)
- && No (Freeze_Node (gnat_entity)))
- || (Is_Itype (gnat_entity)
- && No (Freeze_Node (full_view))))
+ || (Is_Itype (full_view) && No (Freeze_Node (gnat_entity)))
+ || (Is_Itype (gnat_entity) && No (Freeze_Node (full_view))))
{
gnu_decl = gnat_to_gnu_entity (full_view, NULL_TREE, 0);
maybe_present = true;