aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/trans.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/trans.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/trans.c')
-rw-r--r--gcc/ada/gcc-interface/trans.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 57d5235..b5be373 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -4374,7 +4374,6 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target,
Node_Id gnat_name = suppress_type_conversion
? Expression (gnat_actual) : gnat_actual;
tree gnu_name = gnat_to_gnu (gnat_name), gnu_name_type;
- tree gnu_actual;
/* If it's possible we may need to use this expression twice, make sure
that any side-effects are handled via SAVE_EXPRs; likewise if we need
@@ -4504,7 +4503,7 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target,
}
/* Start from the real object and build the actual. */
- gnu_actual = gnu_name;
+ tree gnu_actual = gnu_name;
/* If atomic access is required for an In or In Out actual parameter,
build the atomic load. */
@@ -4524,15 +4523,18 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target,
/* Put back the conversion we suppressed above in the computation of the
real object. And even if we didn't suppress any conversion there, we
may have suppressed a conversion to the Etype of the actual earlier,
- since the parent is a procedure call, so put it back here. */
- if (suppress_type_conversion
- && Nkind (gnat_actual) == N_Unchecked_Type_Conversion)
- gnu_actual
- = unchecked_convert (gnat_to_gnu_type (Etype (gnat_actual)),
- gnu_actual, No_Truncation (gnat_actual));
+ since the parent is a procedure call, so put it back here. Note that
+ we might have a dummy type here if the actual is the dereference of a
+ pointer to it, but that's OK if the formal is passed by reference. */
+ tree gnu_actual_type = gnat_to_gnu_type (Etype (gnat_actual));
+ if (TYPE_IS_DUMMY_P (gnu_actual_type))
+ gcc_assert (is_true_formal_parm && DECL_BY_REF_P (gnu_formal));
+ else if (suppress_type_conversion
+ && Nkind (gnat_actual) == N_Unchecked_Type_Conversion)
+ gnu_actual = unchecked_convert (gnu_actual_type, gnu_actual,
+ No_Truncation (gnat_actual));
else
- gnu_actual
- = convert (gnat_to_gnu_type (Etype (gnat_actual)), gnu_actual);
+ gnu_actual = convert (gnu_actual_type, gnu_actual);
/* Make sure that the actual is in range of the formal's type. */
if (Ekind (gnat_formal) != E_Out_Parameter