https://gcc.gnu.org/g:65c88a1a57a81b16c393224b65db8bb2c8a568cf
commit r15-2622-g65c88a1a57a81b16c393224b65db8bb2c8a568cf Author: Ghjuvan Lacambre <lacam...@adacore.com> Date: Fri Jun 28 10:13:17 2024 +0200 ada: exp_pakd.adb: disable packed expansions in CodePeer_Mode A previous commit disabled the removal of the Component_Size aspect from GNAT's tree when in CodePeer_Mode. This effectively resulted in CodePeer not ignoring Component_Size anymore. As a side effect, GNAT started expanding packed operations on array types from their high-level representations to operations operating on bits. It wasn't caught during the original testing, but this actually confuses CodePeer. We thus need to disable expansion of packed operations while in CodePeer_Mode. gcc/ada/ * exp_pakd.adb (Expand_Bit_Packed_Element_Set): Disable expansion in CodePeerMode. (Expand_Packed_Address_Reference): Likewise. (Expand_Packed_Bit_Reference): Likewise. (Expand_Packed_Boolean_Operator): Likewise. (Expand_Packed_Element_Reference): Likewise. (Expand_Packed_Eq): Likewise. (Expand_Packed_Not): Likewise. Diff: --- gcc/ada/exp_pakd.adb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/gcc/ada/exp_pakd.adb b/gcc/ada/exp_pakd.adb index 59dfe5df8df4..00bf60ae4067 100644 --- a/gcc/ada/exp_pakd.adb +++ b/gcc/ada/exp_pakd.adb @@ -1121,6 +1121,10 @@ package body Exp_Pakd is begin pragma Assert (Is_Bit_Packed_Array (Etype (Prefix (Lhs)))); + if CodePeer_Mode then + return; + end if; + Obj := Relocate_Node (Prefix (Lhs)); Convert_To_Actual_Subtype (Obj); Atyp := Etype (Obj); @@ -1507,6 +1511,11 @@ package body Exp_Pakd is Offset : Node_Id; begin + + if CodePeer_Mode then + return; + end if; + -- We build an expression that has the form -- outer_object'Address @@ -1546,6 +1555,11 @@ package body Exp_Pakd is Offset : Node_Id; begin + + if CodePeer_Mode then + return; + end if; + -- We build an expression that has the form -- (linear-subscript * component_size for each array reference @@ -1581,6 +1595,11 @@ package body Exp_Pakd is PAT : Entity_Id; begin + + if CodePeer_Mode then + return; + end if; + Convert_To_Actual_Subtype (L); Convert_To_Actual_Subtype (R); @@ -1744,6 +1763,11 @@ package body Exp_Pakd is Arg : Node_Id; begin + + if CodePeer_Mode then + return; + end if; + -- If the node is an actual in a call, the prefix has not been fully -- expanded, to account for the additional expansion for in-out actuals -- (see expand_actuals for details). If the prefix itself is a packed @@ -1907,6 +1931,11 @@ package body Exp_Pakd is PAT : Entity_Id; begin + + if CodePeer_Mode then + return; + end if; + Convert_To_Actual_Subtype (L); Convert_To_Actual_Subtype (R); Ltyp := Underlying_Type (Etype (L)); @@ -2004,6 +2033,11 @@ package body Exp_Pakd is Size : Unat; begin + + if CodePeer_Mode then + return; + end if; + Convert_To_Actual_Subtype (Opnd); Rtyp := Etype (Opnd);