From 04dd62123edaa16b41095a9e2736516b728617f0 Mon Sep 17 00:00:00 2001 From: charlet Date: Tue, 30 Aug 2011 13:44:27 +0000 Subject: [PATCH] 2011-08-30 Robert Dewar * gnat_rm.texi: Minor change. * exp_attr_light.adb: Minor reformatting. 2011-08-30 Ed Schonberg * sem_ch3.adb: Patch inheritance of aspects in Complete_Private_Subtype, to avoid infinite loop. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178305 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 10 ++++++++++ gcc/ada/exp_attr_light.adb | 5 +++-- gcc/ada/gnat_rm.texi | 14 -------------- gcc/ada/sem_ch3.adb | 17 ++++++++++++++++- 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ae4edc3..4590435 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,13 @@ +2011-08-30 Robert Dewar + + * gnat_rm.texi: Minor change. + * exp_attr_light.adb: Minor reformatting. + +2011-08-30 Ed Schonberg + + * sem_ch3.adb: Patch inheritance of aspects in + Complete_Private_Subtype, to avoid infinite loop. + 2011-08-30 Javier Miranda * sem_ch3.adb (Add_Internal_Interface_Entities): If serious errors have diff --git a/gcc/ada/exp_attr_light.adb b/gcc/ada/exp_attr_light.adb index 9c63c99..95a22dd 100644 --- a/gcc/ada/exp_attr_light.adb +++ b/gcc/ada/exp_attr_light.adb @@ -35,10 +35,11 @@ package body Exp_Attr_Light is procedure Expand_Light_N_Attribute_Reference (N : Node_Id) is Id : constant Attribute_Id := Get_Attribute_Id (Attribute_Name (N)); + begin case Id is - when Attribute_Old | - Attribute_Result => + when Attribute_Old | + Attribute_Result => Expand_N_Attribute_Reference (N); when others => diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 695b809..5cc0cb6 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -7865,20 +7865,6 @@ entity. @end cartouche Followed. -@cindex pragma Volatile -@findex Volatile -@unnumberedsec C.6(16): Definition of effect of pragma Volatile -@sp 1 -@cartouche -All tasks of the program (on all processors) that read or update volatile -variables see the same order of updates to the variables. -@end cartouche - -The semantics for pragma volatile is that provided by the gcc back-end for -implementation of volatile in C or C++. On some targets this may meet the -serialization requirement stated above. On other targets this implementation -advice is not followed. - @cindex Package @code{Task_Attributes} @findex Task_Attributes @unnumberedsec C.7.2(30): The Package Task_Attributes diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 2d1951f..9ecfb72 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -10312,6 +10312,7 @@ package body Sem_Ch3 is -- type, so we must be sure not to overwrite these entries. declare + Append : Boolean; Item : Node_Id; Next_Item : Node_Id; @@ -10330,15 +10331,29 @@ package body Sem_Ch3 is -- is not done, as that would create a circularity. elsif Item /= First_Rep_Item (Priv) then + Append := True; + loop Next_Item := Next_Rep_Item (Item); exit when No (Next_Item); Item := Next_Item; + + -- If the private view has aspect specifications, the full view + -- inherits them. Since these aspects may already have been + -- attached to the full view during derivation, do not append + -- them if already present. + + if Item = First_Rep_Item (Priv) then + Append := False; + exit; + end if; end loop; -- And link the private type items at the end of the chain - Set_Next_Rep_Item (Item, First_Rep_Item (Priv)); + if Append then + Set_Next_Rep_Item (Item, First_Rep_Item (Priv)); + end if; end if; end; -- 2.7.4