r262766 - in /trunk/gcc: ada/ChangeLog ada/exp_...

pmderodat@gcc.gnu.org pmderodat@gcc.gnu.org
Tue Jul 17 08:03:00 GMT 2018


Author: pmderodat
Date: Tue Jul 17 08:03:44 2018
New Revision: 262766

URL: https://gcc.gnu.org/viewcvs?rev=262766&root=gcc&view=rev
Log:
[Ada] Crash on case expression in build-in-place function

This patch modifies the recursive tree replication routine New_Copy_Tree to
create new entities and remap old entities to the new ones for constructs in
N_Expression_With_Actions nodes when requested by a caller. This in turn allows
the build-in-place mechanism to avoid sharing entities between the 4 variants
of returns it generates.

2018-07-17  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

	* exp_ch6.adb (Build_Heap_Or_Pool_Allocator): Ensure that scoping
	constructs and entities within receive new entities when replicating a
	tree.
	(Expand_N_Extended_Return_Statement): Ensure that scoping constructs
	and entities within receive new entities when replicating a tree.
	* sem_util.adb (New_Copy_Tree): Add new formal Scopes_In_EWA_OK.
	(Visit_Entity): Visit entities within scoping constructs inside
	expression with actions nodes when requested by the caller. Add blocks,
	labels, and procedures to the list of entities which need replication.
	* sem_util.ads (New_Copy_Tree): Add new formal Scopes_In_EWA_OK. Update
	the comment on usage.

gcc/testsuite/

	* gnat.dg/bip_case_expr.adb, gnat.dg/bip_case_expr_pkg.ads: New testcase.

Added:
    trunk/gcc/testsuite/gnat.dg/bip_case_expr.adb
    trunk/gcc/testsuite/gnat.dg/bip_case_expr_pkg.ads
Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/exp_ch6.adb
    trunk/gcc/ada/sem_util.adb
    trunk/gcc/ada/sem_util.ads
    trunk/gcc/testsuite/ChangeLog



More information about the Gcc-cvs mailing list