This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Ada] Avoid use of secondary stack


> This patch avoids the use of the secondary stack, and the corresponding
> cleanup handlers, in many cases. For example, access discriminants no
> longer force functions to return on the secondary stack. This is a speed
> improvement. It is particularly relevant to the Ada.Containers.

It also uncovered a buglet in gigi, fixed thusly, applied on the mainline.


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.


-- 
Eric Botcazou
Index: gcc-interface/decl.c
===================================================================
--- gcc-interface/decl.c	(revision 223834)
+++ gcc-interface/decl.c	(working copy)
@@ -4224,7 +4224,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entit
 	    /* 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)))
 	      {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]