aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch2.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-11-04 13:04:55 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2011-11-04 13:04:55 +0100
commit5972791c345f8e0a750ab5e5cde189ba5064d118 (patch)
treec6023d169c19bbc4f9712b3fa856fbd833835777 /gcc/ada/exp_ch2.adb
parent1a03203481f5f54af8d8ed2b1beda4cb7c47424d (diff)
downloadgcc-5972791c345f8e0a750ab5e5cde189ba5064d118.zip
gcc-5972791c345f8e0a750ab5e5cde189ba5064d118.tar.gz
gcc-5972791c345f8e0a750ab5e5cde189ba5064d118.tar.bz2
[multiple changes]
2011-11-04 Robert Dewar <dewar@adacore.com> * exp_ch2.adb (Expand_Entity_Reference): Do not set Atomic_Sync_Required for the case of a prefix of an attribute. * exp_ch4.adb (Expand_N_Explicit_Dereference): May require atomic synchronization (Expand_N_Indexed_Component): Ditto. (Expand_B_Selected_Component): Ditto. * sem_prag.adb (Process_Suppress_Unsuppress): Disable/Enable_Atomic_Synchronization can now occur for array types with pragma Atomic_Components. * sinfo.ads, sinfo.adb (Atomic_Sync_Required): Can now occur on N_Explicit_Dereference nodes and on N_Indexed_Component nodes. 2011-11-04 Gary Dismukes <dismukes@adacore.com> * gnat_ugn.texi: Editorial corrections for gnattest section. From-SVN: r180943
Diffstat (limited to 'gcc/ada/exp_ch2.adb')
-rw-r--r--gcc/ada/exp_ch2.adb12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ada/exp_ch2.adb b/gcc/ada/exp_ch2.adb
index a1337aa..9726563 100644
--- a/gcc/ada/exp_ch2.adb
+++ b/gcc/ada/exp_ch2.adb
@@ -404,6 +404,15 @@ package body Exp_Ch2 is
if Nkind_In (N, N_Identifier, N_Expanded_Name)
and then Ekind (E) = E_Variable
and then (Is_Atomic (E) or else Is_Atomic (Etype (E)))
+
+ -- Don't go setting the flag for the prefix of an attribute because
+ -- we don't want atomic sync for X'Size, X'Access etc.
+
+ -- Is this right in all cases of attributes???
+ -- Are there other exemptions required ???
+
+ and then (Nkind (Parent (N)) /= N_Attribute_Reference
+ or else Prefix (Parent (N)) /= N)
then
declare
Set : Boolean;
@@ -444,6 +453,7 @@ package body Exp_Ch2 is
-- Set flag if required
if Set then
+ Set_Atomic_Sync_Required (N);
-- Generate info message if requested
@@ -457,8 +467,6 @@ package body Exp_Ch2 is
Error_Msg_N
("?info: atomic synchronization set for &", MLoc);
end if;
-
- Set_Atomic_Sync_Required (N);
end if;
end;
end if;