diff options
author | Ed Schonberg <schonberg@adacore.com> | 2018-05-30 08:58:40 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-05-30 08:58:40 +0000 |
commit | 392a7e19fd9750110d1931732ac34105460206f6 (patch) | |
tree | 80b358e46a820efc4de9606010bee23954ee1b8b /gcc | |
parent | 656d1fba78c6a743d8d65a1383400a756dfd9222 (diff) | |
download | gcc-392a7e19fd9750110d1931732ac34105460206f6.zip gcc-392a7e19fd9750110d1931732ac34105460206f6.tar.gz gcc-392a7e19fd9750110d1931732ac34105460206f6.tar.bz2 |
[Ada] Unnesting: skip unanalyzed Component_Assocation
2018-05-30 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* exp_unst.adb (Visit_Node): Do not traverse a Component_Association
that has not been analyzed, as will be the case for a nested aggregate
that is expanded into individual assignments.
From-SVN: r260946
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ada/exp_unst.adb | 13 |
2 files changed, 17 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index b839b7a..1e810bb 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2018-05-30 Ed Schonberg <schonberg@adacore.com> + + * exp_unst.adb (Visit_Node): Do not traverse a Component_Association + that has not been analyzed, as will be the case for a nested aggregate + that is expanded into individual assignments. + 2018-05-30 Justin Squirek <squirek@adacore.com> * aspects.adb, aspects.ads: Register new aspect. diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index b394f21..7935306 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -775,6 +775,16 @@ package body Exp_Unst is end case; end; + -- Component associations in aggregates are either static + -- or else the aggregate will be expanded into assignments, + -- in which case the expression is analyzed later and provides + -- no relevant code generation. + + when N_Component_Association => + if No (Etype (Expression (N))) then + return Skip; + end if; + -- Indexed references can be uplevel if the type isn't static -- and if the lower bound (or an inner bound for a multi- -- dimensional array) is uplevel. @@ -1865,8 +1875,7 @@ package body Exp_Unst is begin if Present (STT.ARECnF) - and then Nkind (CTJ.N) /= N_Attribute_Reference - and then Nkind (CTJ.N) /= N_Handled_Sequence_Of_Statements + and then Nkind (CTJ.N) in N_Subprogram_Call then -- CTJ.N is a call to a subprogram which may require a pointer -- to an activation record. The subprogram containing the call |