aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2012-01-21 14:58:33 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-01-21 14:58:33 +0000
commit7eeb2aa717484ca0055e2274f50a49bc9565d1eb (patch)
tree2ffb84bf4d4a6e8715c3955d4a047ef199311ac7 /gcc/ada
parent188229eb535a47b63c33dc12c71bf0575b44ce17 (diff)
downloadgcc-7eeb2aa717484ca0055e2274f50a49bc9565d1eb.zip
gcc-7eeb2aa717484ca0055e2274f50a49bc9565d1eb.tar.gz
gcc-7eeb2aa717484ca0055e2274f50a49bc9565d1eb.tar.bz2
re PR ada/46192 (wrong code for renaming of volatile packed array with address clause)
PR ada/46192 * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: In the case of a renaming, preserve the volatileness through the indirection, if any. From-SVN: r183365
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/gcc-interface/decl.c8
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 1960e1a..a961439 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/46192
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: In the case of a
+ renaming, preserve the volatileness through the indirection, if any.
+
2012-01-14 Andreas Schwab <schwab@linux-m68k.org>
* gcc-interface/Makefile.in (OSCONS_EXTRACT): Add
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 89a6a2e..9d81ade 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -1051,6 +1051,14 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
entity is always accessed indirectly through it. */
else
{
+ /* We need to preserve the volatileness of the renamed
+ object through the indirection. */
+ if (TREE_THIS_VOLATILE (gnu_expr)
+ && !TYPE_VOLATILE (gnu_type))
+ gnu_type
+ = build_qualified_type (gnu_type,
+ (TYPE_QUALS (gnu_type)
+ | TYPE_QUAL_VOLATILE));
gnu_type = build_reference_type (gnu_type);
inner_const_flag = TREE_READONLY (gnu_expr);
const_flag = true;