diff options
author | Robert Dewar <dewar@adacore.com> | 2015-05-22 12:53:21 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-05-22 14:53:21 +0200 |
commit | f280dd8f6d4e3f95357707c3064253cb87698b66 (patch) | |
tree | b66b44d98a027fc0c33dc1f86e1a61404d3d06d2 /gcc/ada/layout.adb | |
parent | 878e58c85ed67d4090e7e04d27695e892bc78580 (diff) | |
download | gcc-f280dd8f6d4e3f95357707c3064253cb87698b66.zip gcc-f280dd8f6d4e3f95357707c3064253cb87698b66.tar.gz gcc-f280dd8f6d4e3f95357707c3064253cb87698b66.tar.bz2 |
exp_ch5.adb, [...]: This is a general change that deals with the fact that most of the special...
2015-05-22 Robert Dewar <dewar@adacore.com>
* exp_ch5.adb, layout.adb, einfo.adb, einfo.ads, sem_prag.adb,
freeze.adb, freeze.ads, sem_util.adb, sem_util.ads, exp_ch2.adb,
exp_ch4.adb, errout.adb, exp_aggr.adb, sem_ch13.adb: This is a general
change that deals with the fact that most of the special coding for
Atomic should also apply to the case of Volatile_Full_Access.
A new attribute Is_Atomic_Or_VFA is introduced, and many of the
references to Is_Atomic now use this new attribute.
From-SVN: r223560
Diffstat (limited to 'gcc/ada/layout.adb')
-rw-r--r-- | gcc/ada/layout.adb | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/gcc/ada/layout.adb b/gcc/ada/layout.adb index 7721eef..c449416 100644 --- a/gcc/ada/layout.adb +++ b/gcc/ada/layout.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2014, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2015, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -2684,11 +2684,11 @@ package body Layout is elsif Is_Array_Type (E) then - -- For arrays that are required to be atomic, we do the same + -- For arrays that are required to be atomic/VFA, we do the same -- processing as described above for short records, since we -- really need to have the alignment set for the whole array. - if Is_Atomic (E) and then not Debug_Flag_Q then + if Is_Atomic_Or_VFA (E) and then not Debug_Flag_Q then Set_Composite_Alignment (E); end if; @@ -2903,11 +2903,19 @@ package body Layout is and then Is_Record_Type (E) and then Is_Packed (E) then - -- No effect for record with atomic components + -- No effect for record with atomic/VFA components - if Is_Atomic (E) then + if Is_Atomic_Or_VFA (E) then Error_Msg_N ("Optimize_Alignment has no effect for &??", E); - Error_Msg_N ("\pragma ignored for atomic record??", E); + + if Is_Atomic (E) then + Error_Msg_N + ("\pragma ignored for atomic record??", E); + else + Error_Msg_N + ("\pragma ignored for bolatile full access record??", E); + end if; + return; end if; @@ -2920,20 +2928,30 @@ package body Layout is return; end if; - -- No effect if any component is atomic or is a by reference type + -- No effect if any component is atomic/VFA or is a by reference type declare Ent : Entity_Id; + begin Ent := First_Component_Or_Discriminant (E); while Present (Ent) loop if Is_By_Reference_Type (Etype (Ent)) - or else Is_Atomic (Etype (Ent)) - or else Is_Atomic (Ent) + or else Is_Atomic_Or_VFA (Etype (Ent)) + or else Is_Atomic_Or_VFA (Ent) then Error_Msg_N ("Optimize_Alignment has no effect for &??", E); - Error_Msg_N - ("\pragma is ignored if atomic components present??", E); + + if Is_Atomic (Etype (Ent)) or else Is_Atomic (Ent) then + Error_Msg_N + ("\pragma is ignored if atomic " + & "components present??", E); + else + Error_Msg_N + ("\pragma is ignored if bolatile full access " + & "components present??", E); + end if; + return; else Next_Component_Or_Discriminant (Ent); @@ -3026,9 +3044,9 @@ package body Layout is -- Further processing for record types only to reduce the alignment -- set by the above processing in some specific cases. We do not - -- do this for atomic records, since we need max alignment there, + -- do this for atomic/VFA records, since we need max alignment there, - if Is_Record_Type (E) and then not Is_Atomic (E) then + if Is_Record_Type (E) and then not Is_Atomic_Or_VFA (E) then -- For records, there is generally no point in setting alignment -- higher than word size since we cannot do better than move by |