aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2014-01-20 10:59:26 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2014-01-20 10:59:26 +0000
commitfd6e497e9cb9f0efe0375c65dddbe86f8e536f56 (patch)
tree853a13747cde23451982d1083de9ba5cd2aac839 /gcc/ada/gcc-interface/decl.c
parent608df31fded5fedc0f1e0b4fed35dfb0ea4aa84f (diff)
downloadgcc-fd6e497e9cb9f0efe0375c65dddbe86f8e536f56.zip
gcc-fd6e497e9cb9f0efe0375c65dddbe86f8e536f56.tar.gz
gcc-fd6e497e9cb9f0efe0375c65dddbe86f8e536f56.tar.bz2
decl.c (gnat_to_gnu_entity): Robustify tests for aliased objects with an unconstrained nominal subtype.
* 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. From-SVN: r206798
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 dd912f3..5259ad4 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;