diff options
Diffstat (limited to 'gcc/ada/exp_util.adb')
-rw-r--r-- | gcc/ada/exp_util.adb | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 632c879892e..314e3ee97cd 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -8402,26 +8402,23 @@ package body Exp_Util is declare Align_In_Bits : constant Nat := M * System_Storage_Unit; - Off : Uint; - Siz : Uint; + Comp : Entity_Id; + begin + Comp := C; + -- For a component inherited in a record extension, the -- clause is inherited but position and size are not set. if Is_Base_Type (Etype (P)) and then Is_Tagged_Type (Etype (P)) - and then Present (Original_Record_Component (C)) + and then Present (Original_Record_Component (Comp)) then - Off := - Component_Bit_Offset (Original_Record_Component (C)); - Siz := Esize (Original_Record_Component (C)); - else - Off := Component_Bit_Offset (C); - Siz := Esize (C); + Comp := Original_Record_Component (Comp); end if; - if Off mod Align_In_Bits /= 0 - or else Siz mod Align_In_Bits /= 0 + if Component_Bit_Offset (Comp) mod Align_In_Bits /= 0 + or else Esize (Comp) mod Align_In_Bits /= 0 then return True; end if; |