aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/decl.c')
-rw-r--r--gcc/ada/decl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index ca7d78c..ce93a169 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -1048,6 +1048,14 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
DECL_BY_REF_P (gnu_decl) = used_by_ref;
DECL_POINTS_TO_READONLY_P (gnu_decl) = used_by_ref && inner_const_flag;
+ /* If we have an address clause and we've made this indirect, it's
+ not enough to merely mark the type as volatile since volatile
+ references only conflict with other volatile references while this
+ reference must conflict with all other references. So ensure that
+ the dereferenced value has alias set 0. */
+ if (Present (Address_Clause (gnat_entity)) && used_by_ref)
+ DECL_POINTER_ALIAS_SET (gnu_decl) = 0;
+
if (definition && DECL_SIZE (gnu_decl) != 0
&& gnu_block_stack != 0
&& TREE_VALUE (gnu_block_stack) != 0