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]

[Ada] No_Allocators should suppress heap allocation in build-in-place returns


Tested on i686-linux, committed on trunk

When the restriction No_Allocators is active, the compiler no longer
generates a heap allocator as part of the expansion of return statements
within limited functions with unconstrained results, since those are
only needed to perform allocation on behalf of an allocator written by
the user. As a related change, No_Allocators is now only checked for
explicit allocators (those marked as Comes_From_Source), in conformance
with Ada RM H.4(7), preventing the issuing of errors on cases such as the
secondary-stack allocator generated for limited unconstrained function
returns.

gnat.dg/test_bip_no_alloc.adb must now compile quietly.

2008-03-26  Gary Dismukes  <dismukes@adacore.com>

	* exp_ch5.adb (Expand_N_Extended_Return_Statement): Suppress generation
	of a heap allocator for a limited unconstrained function return when
	resstriction No_Allocators is active.
	(Analyze_Allocator): The restriction No_Allocators is now only checked
	on allocators that have Comes_From_Source set, as per RM-H.4(7).

	* sem_ch4.adb (Expand_N_Extended_Return_Statement): Suppress generation
	of a heap allocator for a limited unconstrained function return when
	resstriction No_Allocators is active.
	(Analyze_Allocator): The restriction No_Allocators is now only checked
	on allocators that have Comes_From_Source set, as per RM-H.4(7).
	(Has_Fixed_Op):  If the name in a function call is Standard."*" and the
	operands are fixed-point types, the universal_fixed predefined operation
	is used, regardless of whether the operand type (s) have a primitive
	operation of the same name.

Attachment: difs
Description: Text document


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