diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-05-22 12:53:21 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-05-22 12:53:21 +0000 |
commit | 2fe893b952031310e96bba64f19bf6530fd2b2e3 (patch) | |
tree | b66b44d98a027fc0c33dc1f86e1a61404d3d06d2 /gcc/ada/layout.adb | |
parent | 36625869d3f0688597d79eed21cbb7459d70c0e7 (diff) | |
download | gcc-2fe893b952031310e96bba64f19bf6530fd2b2e3.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223560 138bc75d-0d04-0410-961f-82ee72b054a4
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 7721eefdd9d..c44941667ba 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 |