diff options
-rw-r--r-- | gcc/ada/atree.adb | 10 | ||||
-rw-r--r-- | gcc/ada/atree.ads | 1 | ||||
-rw-r--r-- | gcc/ada/einfo-utils.adb | 3 | ||||
-rw-r--r-- | gcc/ada/sem_ch13.adb | 3 |
4 files changed, 12 insertions, 5 deletions
diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb index 540d4ff..d69d403 100644 --- a/gcc/ada/atree.adb +++ b/gcc/ada/atree.adb @@ -2025,10 +2025,16 @@ package body Atree is -- Both the old and new copies of the node will share the same list -- of aspect specifications if aspect specifications are present. + -- Restore the parent link of the aspect list to the old node, which + -- is the one linked in the tree. if Old_Has_Aspects then - Set_Aspect_Specifications - (Sav_Node, Aspect_Specifications (Old_Node)); + declare + Aspects : constant List_Id := Aspect_Specifications (Old_Node); + begin + Set_Aspect_Specifications (Sav_Node, Aspects); + Set_Parent (Aspects, Old_Node); + end; end if; end if; diff --git a/gcc/ada/atree.ads b/gcc/ada/atree.ads index 6fb5aa6..94e589e 100644 --- a/gcc/ada/atree.ads +++ b/gcc/ada/atree.ads @@ -501,6 +501,7 @@ package Atree is -- the contents of these two nodes fixing up the parent pointers of the -- replaced node (we do not attempt to preserve parent pointers for the -- original node). Neither Old_Node nor New_Node can be extended nodes. + -- ??? The above explanation is incorrect, instead Copy_Node is called. -- -- Note: New_Node may not contain references to Old_Node, for example as -- descendants, since the rewrite would make such references invalid. If diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb index 15bd9e8..cbd957b 100644 --- a/gcc/ada/einfo-utils.adb +++ b/gcc/ada/einfo-utils.adb @@ -414,8 +414,7 @@ package body Einfo.Utils is if Use_New_Unknown_Rep then return not Field_Is_Initial_Zero (E, F_Esize); else - return Esize (E) /= Uint_0 - and then Present (Esize (E)); + return Present (Esize (E)) and then Esize (E) /= Uint_0; end if; end Known_Esize; diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 2a5e86d..8bc8490 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -860,6 +860,7 @@ package body Sem_Ch13 is if Known_Alignment (Typ) and then not Has_Alignment_Clause (Typ) + and then Present (Size) and then Size mod (Alignment (Typ) * SSU) /= 0 then Reinit_Alignment (Typ); @@ -7125,7 +7126,7 @@ package body Sem_Ch13 is else Check_Size (Expr, U_Ent, Size, Biased); - if Size <= 0 then + if No (Size) or else Size <= 0 then Error_Msg_N ("Object_Size must be positive", Expr); elsif Is_Scalar_Type (U_Ent) then |