diff options
author | Bob Duff <duff@adacore.com> | 2019-09-18 08:33:49 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-09-18 08:33:49 +0000 |
commit | 58ab1e7607d7e464ba1e4fa3d4986da934903b5c (patch) | |
tree | 386c1ad2d91b3eb509e7d45c4bf47fb4de33c38b | |
parent | 5c13a04e0dcb6e6c07708dc6796968ee89b4560b (diff) | |
download | gcc-58ab1e7607d7e464ba1e4fa3d4986da934903b5c.zip gcc-58ab1e7607d7e464ba1e4fa3d4986da934903b5c.tar.gz gcc-58ab1e7607d7e464ba1e4fa3d4986da934903b5c.tar.bz2 |
[Ada] Avoid gnatbind regression caused by Copy_Bitfield
The recent Copy_Bitfield change caused gnatbind to change elaboration
order, causing different error messages.
2019-09-18 Bob Duff <duff@adacore.com>
gcc/ada/
* exp_ch5.adb (Expand_Assign_Array_Loop_Or_Bitfield): Move call
to RTE_Available later, so it doesn't disturb the elab order.
The RE_Copy_Bitfield entity is defined in package
System.Bitfields which has a dependency on package
System.Bitfield_Utils, which has it its spec:
pragma Elaborate_Body;
The query on RTE_Available forces loading and analyzing
System.Bitfields and all its withed units.
From-SVN: r275866
-rw-r--r-- | gcc/ada/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/ada/exp_ch5.adb | 4 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 240bc08..c42498e 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2019-09-18 Bob Duff <duff@adacore.com> + + * exp_ch5.adb (Expand_Assign_Array_Loop_Or_Bitfield): Move call + to RTE_Available later, so it doesn't disturb the elab order. + The RE_Copy_Bitfield entity is defined in package + System.Bitfields which has a dependency on package + System.Bitfield_Utils, which has it its spec: + pragma Elaborate_Body; + The query on RTE_Available forces loading and analyzing + System.Bitfields and all its withed units. + 2019-09-18 Eric Botcazou <ebotcazou@adacore.com> * checks.ads (Alignment_Warnings_Record): Add P component. diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index f5c1f21..4bbe86a 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -1475,8 +1475,7 @@ package body Exp_Ch5 is -- optimization in that case as well. We could complicate this code by -- actually looking for such volatile and independent components. - if RTE_Available (RE_Copy_Bitfield) - and then Is_Bit_Packed_Array (L_Type) + if Is_Bit_Packed_Array (L_Type) and then Is_Bit_Packed_Array (R_Type) and then not Reverse_Storage_Order (L_Type) and then not Reverse_Storage_Order (R_Type) @@ -1489,6 +1488,7 @@ package body Exp_Ch5 is and then not Has_Independent_Components (R_Type) and then not L_Prefix_Comp and then not R_Prefix_Comp + and then RTE_Available (RE_Copy_Bitfield) then return Expand_Assign_Array_Bitfield (N, Larray, Rarray, L_Type, R_Type, Rev); |