aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2016-07-14 11:12:22 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2016-07-14 11:12:22 +0000
commit8234d02aa47d9cba294b4263e47a336e9c67f5b1 (patch)
treee287b2e3d8edcae34b5fd6a01c46dd42a2598056 /gcc/ada/gcc-interface/decl.c
parent0a2bf18874eb2c54202b9890f3b82776b08e55a1 (diff)
downloadgcc-8234d02aa47d9cba294b4263e47a336e9c67f5b1.zip
gcc-8234d02aa47d9cba294b4263e47a336e9c67f5b1.tar.gz
gcc-8234d02aa47d9cba294b4263e47a336e9c67f5b1.tar.bz2
decl.c (gnat_to_gnu_entity): Also use the void pointer type if the designated type is incomplete and has no...
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Access_Type>: Also use the void pointer type if the designated type is incomplete and has no full view in LTO mode. <E_Access_Protected_Subprogram_Type>: Adjust comment. <E_Incomplete_Type>: Likewise. * gcc-interface/trans.c (Call_to_gnu): Do not convert to the type of the actual if it is a dummy type. From-SVN: r238333
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 67ba612..3f468b6 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -3928,10 +3928,19 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
}
/* If expansion is disabled, the equivalent type of a concurrent type
- is absent, so build a dummy pointer type. */
+ is absent, so we use the void pointer type. */
else if (type_annotate_only && No (gnat_desig_equiv))
gnu_type = ptr_type_node;
+ /* If the ultimately designated type is an incomplete type with no full
+ view, we use the void pointer type in LTO mode to avoid emitting a
+ dummy type in the GIMPLE IR. We cannot do that in regular mode as
+ the name of the dummy type in used by GDB for a global lookup. */
+ else if (Ekind (gnat_desig_rep) == E_Incomplete_Type
+ && No (Full_View (gnat_desig_rep))
+ && flag_generate_lto)
+ gnu_type = ptr_type_node;
+
/* Finally, handle the default case where we can just elaborate our
designated type. */
else
@@ -4017,7 +4026,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
case E_Access_Protected_Subprogram_Type:
case E_Anonymous_Access_Protected_Subprogram_Type:
/* If we are just annotating types and have no equivalent record type,
- just return ptr_void_type. */
+ just use the void pointer type. */
if (type_annotate_only && gnat_equiv_type == gnat_entity)
gnu_type = ptr_type_node;
@@ -4336,8 +4345,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
: Empty;
/* If this is an incomplete type with no full view, it must be a Taft
- Amendment type, in which case we return a dummy type. Otherwise,
- just get the type from its Etype. */
+ Amendment type or an incomplete type coming from a limited context,
+ in which cases we return a dummy type. Otherwise, we just get the
+ type from its Etype. */
if (No (full_view))
{
if (kind == E_Incomplete_Type)