+2013-10-14 Tristan Gingold <gingold@adacore.com>
+
+ * a-exexpr-gcc.adb: Adjust comment.
+ (Others_Value, All_Others_Value,
+ Unhandled_Others_Value): Declare as Character to slightly reduce
+ memory footprint.
+
+2013-10-14 Robert Dewar <dewar@adacore.com>
+
+ * freeze.adb (Size_Known): Size is not known for packed record
+ with aliased components
+
2013-10-14 Robert Dewar <dewar@adacore.com>
* sem_ch3.adb: Minor fix to error message.
---------------------------------------------------------------------------
-- Currently, these only have their address taken and compared so there is
- -- no real point having whole exception data blocks allocated. In any case
- -- the types should match what gigi and the personality routine expect.
- -- The initial value is an arbitrary value that will not exceed the range
- -- of Integer on 16-bit targets (such as AAMP).
+ -- no real point having whole exception data blocks allocated.
- Others_Value : constant Integer := 16#7FFF#;
+ Others_Value : constant Character := 'O';
pragma Export (C, Others_Value, "__gnat_others_value");
- All_Others_Value : constant Integer := 16#7FFF#;
+ All_Others_Value : constant Character := 'A';
pragma Export (C, All_Others_Value, "__gnat_all_others_value");
- Unhandled_Others_Value : constant Integer := 16#7FFF#;
+ Unhandled_Others_Value : constant Character := 'U';
pragma Export (C, Unhandled_Others_Value, "__gnat_unhandled_others_value");
-- Special choice (emitted by gigi) to catch and notify unhandled
-- exceptions on targets which always handle exceptions (such as SEH).
procedure Set_Foreign_Occurrence (Excep : EOA; Mo : System.Address) is
begin
- Excep.Id := Foreign_Exception'Access;
- Excep.Machine_Occurrence := Mo;
- Excep.Msg_Length := 0;
- Excep.Exception_Raised := True;
- Excep.Pid := Local_Partition_ID;
- Excep.Num_Tracebacks := 0;
+ Excep.all := (
+ Id => Foreign_Exception'Access,
+ Machine_Occurrence => Mo,
+ Msg => <>,
+ Msg_Length => 0,
+ Exception_Raised => True,
+ Pid => Local_Partition_ID,
+ Num_Tracebacks => 0,
+ Tracebacks => <>);
end Set_Foreign_Occurrence;
-------------------------
and then not Has_Independent_Components (T);
Packed_Size : Uint := Uint_0;
- -- SIze in bis so far
+ -- Size in bits so far
begin
-- Test for variant part present
end if;
-- We do not know the packed size if we have a by reference
- -- type, or an atomic type or an atomic component.
+ -- type, or an atomic type or an atomic component, or an
+ -- aliased component (because packing does not touch these).
if Is_Atomic (Ctyp)
or else Is_Atomic (Comp)
or else Is_By_Reference_Type (Ctyp)
+ or else Is_Aliased (Comp)
then
Packed_Size_Known := False;
end if;
-- clause (used to warn about useless Bit_Order pragmas, and also
-- to detect cases where Implicit_Packing may have an effect).
+ Aliased_Component : Boolean := False;
+ -- Set True if we find at least one component which is aliased. This
+ -- is used to prevent Implicit_Packing of the record, since packing
+ -- cannot modify the size of alignment of an aliased component.
+
All_Scalar_Components : Boolean := True;
-- Set False if we encounter a component of a non-scalar type
Comp := First_Entity (Rec);
Prev := Empty;
while Present (Comp) loop
+ if Is_Aliased (Comp) then
+ Aliased_Component := True;
+ end if;
-- Handle the component and discriminant case
and then not Placed_Component
+ -- Or even one component is aliased
+
+ and then not Aliased_Component
+
-- Must have size clause and all scalar components
and then Has_Size_Clause (Rec)