diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2018-09-26 09:16:49 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-09-26 09:16:49 +0000 |
commit | 3b9d159401751981118415b472dd0bdb68e862f6 (patch) | |
tree | 784b824f3eb73fef6ee98fbc3e7a2dfbfbd4f130 /gcc/ada/gcc-interface/decl.c | |
parent | 1ac984f5952c52f0f70e64f5ab7a99fa62877df7 (diff) | |
download | gcc-3b9d159401751981118415b472dd0bdb68e862f6.zip gcc-3b9d159401751981118415b472dd0bdb68e862f6.tar.gz gcc-3b9d159401751981118415b472dd0bdb68e862f6.tar.bz2 |
[Ada] Wrong handling of address clause for limited record type
2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Adjust
code retrieving the address when a clause has already been
processed.
* gcc-interface/trans.c (gnat_to_gnu)
<N_Attribute_Definition_Clause>: For an object with a Freeze
node, build a meaningful expression.
gcc/testsuite/
* gnat.dg/addr12.adb, gnat.dg/addr12_a.adb,
gnat.dg/addr12_a.ads, gnat.dg/addr12_b.adb,
gnat.dg/addr12_b.ads, gnat.dg/addr12_c.ads: New testcase.
From-SVN: r264606
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 6f605bd..c15b0c8 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -1147,10 +1147,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) if (definition && Present (Address_Clause (gnat_entity))) { const Node_Id gnat_clause = Address_Clause (gnat_entity); - Node_Id gnat_address = Expression (gnat_clause); - tree gnu_address - = present_gnu_tree (gnat_entity) - ? get_gnu_tree (gnat_entity) : gnat_to_gnu (gnat_address); + const Node_Id gnat_address = Expression (gnat_clause); + tree gnu_address = present_gnu_tree (gnat_entity) + ? TREE_OPERAND (get_gnu_tree (gnat_entity), 0) + : gnat_to_gnu (gnat_address); save_gnu_tree (gnat_entity, NULL_TREE, false); |