aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2015-05-28 15:37:57 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2015-05-28 15:37:57 +0000
commitafd6f7023570710172c76f5afc870d7ebd32678e (patch)
tree11d5c7fed4d6e307b8d871f51535281266eda1ca /gcc/ada
parent7971481596bce205104973904b140708593c1ebb (diff)
downloadgcc-afd6f7023570710172c76f5afc870d7ebd32678e.zip
gcc-afd6f7023570710172c76f5afc870d7ebd32678e.tar.gz
gcc-afd6f7023570710172c76f5afc870d7ebd32678e.tar.bz2
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) <E_Subprogram_Type>: 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
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/gcc-interface/decl.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 54c5111..8ebf666 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,11 @@
2015-05-28 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Subprogram_Type>: 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 <ebotcazou@adacore.com>
+
* gcc-interface/utils.c (gnat_pushdecl): Reunify the handling of array
and pointer types wrt DECL_ORIGINAL_TYPE and adjust left and right.
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index f955efc..0142e8e 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)))
{