From afd6f7023570710172c76f5afc870d7ebd32678e Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Thu, 28 May 2015 15:37:57 +0000 Subject: [PATCH] decl.c (gnat_to_gnu_entity): Do not error out on a return type which has a size that overflows if... * gcc-interface/decl.c (gnat_to_gnu_entity) : Do not error out on a return type which has a size that overflows if the return is done by invisible reference. From-SVN: r223836 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/gcc-interface/decl.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 54c51110402..8ebf666b6ec 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2015-05-28 Eric Botcazou + + * gcc-interface/decl.c (gnat_to_gnu_entity) : Do + not error out on a return type which has a size that overflows if the + return is done by invisible reference. + 2015-05-28 Eric Botcazou * gcc-interface/utils.c (gnat_pushdecl): Reunify the handling of array diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index f955efc8797..0142e8e56b3 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -4224,7 +4224,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) /* If the return type has a size that overflows, we cannot have a function that returns that type. This usage doesn't make sense anyway, so give an error here. */ - if (TYPE_SIZE_UNIT (gnu_return_type) + if (!return_by_invisi_ref_p + && TYPE_SIZE_UNIT (gnu_return_type) && TREE_CODE (TYPE_SIZE_UNIT (gnu_return_type)) == INTEGER_CST && !valid_constant_size_p (TYPE_SIZE_UNIT (gnu_return_type))) { -- 2.30.2