aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch2.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-11-04 14:48:52 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2011-11-04 14:48:52 +0100
commit4c3182538905f7e806afcf2358825cce22183991 (patch)
tree862c171a1d33635f2b5e29e17a82001c59d22f4e /gcc/ada/exp_ch2.adb
parent37765e95f1b10191c37f6d185a3621cfd7ccdfd9 (diff)
downloadgcc-4c3182538905f7e806afcf2358825cce22183991.zip
gcc-4c3182538905f7e806afcf2358825cce22183991.tar.gz
gcc-4c3182538905f7e806afcf2358825cce22183991.tar.bz2
[multiple changes]
2011-11-04 Yannick Moy <moy@adacore.com> * sem_prag.adb: Minor refactoring (renaming of a parameter). 2011-11-04 Robert Dewar <dewar@adacore.com> * atree.ads: Minor reformatting. 2011-11-04 Robert Dewar <dewar@adacore.com> * checks.adb (Atomic_Synchronization_Disabled): Check -gnatd.d and -gnatd.e here * exp_ch2.adb (Expand_Entity_Reference): Use Activate_Atomic_Synchronization * exp_ch4.adb (Expand_N_Explicit_Dereference): Use Activate_Atomic_Synchronization (Expand_N_Indexed_Compoonent): Activate_Atomic_Synchronization (Expand_N_Selected_Component): Use Activate_Atomic_Synchronization * exp_util.ads, exp_util.adb (Activate_Atomic_Synchronization): New procedure. * sinfo.ads, sinfo.adb (Atomic_Sync_Required): Can now apply to N_Selected_Component node From-SVN: r180950
Diffstat (limited to 'gcc/ada/exp_ch2.adb')
-rw-r--r--gcc/ada/exp_ch2.adb37
1 files changed, 2 insertions, 35 deletions
diff --git a/gcc/ada/exp_ch2.adb b/gcc/ada/exp_ch2.adb
index 9726563..80f381b 100644
--- a/gcc/ada/exp_ch2.adb
+++ b/gcc/ada/exp_ch2.adb
@@ -404,35 +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;
- MLoc : Node_Id;
begin
- -- Always set if debug flag d.e is set
-
- if Debug_Flag_Dot_E then
- Set := True;
-
- -- Never set if debug flag d.d is set
-
- elsif Debug_Flag_Dot_D then
- Set := False;
-
-- If variable is atomic, but type is not, setting depends on
-- disable/enable state for the variable.
- elsif Is_Atomic (E) and then not Is_Atomic (Etype (E)) then
+ if Is_Atomic (E) and then not Is_Atomic (Etype (E)) then
Set := not Atomic_Synchronization_Disabled (E);
-- If variable is not atomic, but its type is atomic, setting
@@ -453,20 +433,7 @@ package body Exp_Ch2 is
-- Set flag if required
if Set then
- Set_Atomic_Sync_Required (N);
-
- -- Generate info message if requested
-
- if Warn_On_Atomic_Synchronization then
- if Nkind (N) = N_Identifier then
- MLoc := N;
- else
- MLoc := Selector_Name (N);
- end if;
-
- Error_Msg_N
- ("?info: atomic synchronization set for &", MLoc);
- end if;
+ Activate_Atomic_Synchronization (N);
end if;
end;
end if;