decl.c (gnat_to_gnu_entity): Do not error out on a return type which has a size that...
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 28 May 2015 15:37:57 +0000 (15:37 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 28 May 2015 15:37:57 +0000 (15:37 +0000)
* 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

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c

index 54c51110402c6de2a36bb9922811d099eb1520e4..8ebf666b6ec7957d1211c934a8760a72fcbe7836 100644 (file)
@@ -1,3 +1,9 @@
+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
index f955efc8797b12b9822c4ccaf0e855c7ea4529c7..0142e8e56b36cf5234d8f224da2f8cb2309f44c9 100644 (file)
@@ -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)))
              {