diff options
author | Hristian Kirtchev <kirtchev@adacore.com> | 2018-07-17 08:03:44 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-07-17 08:03:44 +0000 |
commit | 6a4f3b312e2aa6016963a6befc986b93465be968 (patch) | |
tree | f1fb95d6b8c3299b2d69dba33e5faea1fa90d1c1 /gcc/builtins.c | |
parent | 5a3c20f80eb2ca30c721fcab728529589c80c414 (diff) | |
download | gcc-6a4f3b312e2aa6016963a6befc986b93465be968.zip gcc-6a4f3b312e2aa6016963a6befc986b93465be968.tar.gz gcc-6a4f3b312e2aa6016963a6befc986b93465be968.tar.bz2 |
[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.
From-SVN: r262766
Diffstat (limited to 'gcc/builtins.c')
0 files changed, 0 insertions, 0 deletions