[multiple changes]
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 From-SVN: r203555
This commit is contained in:
parent
808876a99a
commit
515490e000
|
@ -1,3 +1,15 @@
|
||||||
|
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>
|
2013-10-14 Robert Dewar <dewar@adacore.com>
|
||||||
|
|
||||||
* sem_ch3.adb: Minor fix to error message.
|
* sem_ch3.adb: Minor fix to error message.
|
||||||
|
|
|
@ -295,18 +295,15 @@ package body Exception_Propagation is
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
-- Currently, these only have their address taken and compared so there is
|
-- Currently, these only have their address taken and compared so there is
|
||||||
-- no real point having whole exception data blocks allocated. In any case
|
-- no real point having whole exception data blocks allocated.
|
||||||
-- 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).
|
|
||||||
|
|
||||||
Others_Value : constant Integer := 16#7FFF#;
|
Others_Value : constant Character := 'O';
|
||||||
pragma Export (C, Others_Value, "__gnat_others_value");
|
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");
|
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");
|
pragma Export (C, Unhandled_Others_Value, "__gnat_unhandled_others_value");
|
||||||
-- Special choice (emitted by gigi) to catch and notify unhandled
|
-- Special choice (emitted by gigi) to catch and notify unhandled
|
||||||
-- exceptions on targets which always handle exceptions (such as SEH).
|
-- exceptions on targets which always handle exceptions (such as SEH).
|
||||||
|
@ -357,12 +354,15 @@ package body Exception_Propagation is
|
||||||
|
|
||||||
procedure Set_Foreign_Occurrence (Excep : EOA; Mo : System.Address) is
|
procedure Set_Foreign_Occurrence (Excep : EOA; Mo : System.Address) is
|
||||||
begin
|
begin
|
||||||
Excep.Id := Foreign_Exception'Access;
|
Excep.all := (
|
||||||
Excep.Machine_Occurrence := Mo;
|
Id => Foreign_Exception'Access,
|
||||||
Excep.Msg_Length := 0;
|
Machine_Occurrence => Mo,
|
||||||
Excep.Exception_Raised := True;
|
Msg => <>,
|
||||||
Excep.Pid := Local_Partition_ID;
|
Msg_Length => 0,
|
||||||
Excep.Num_Tracebacks := 0;
|
Exception_Raised => True,
|
||||||
|
Pid => Local_Partition_ID,
|
||||||
|
Num_Tracebacks => 0,
|
||||||
|
Tracebacks => <>);
|
||||||
end Set_Foreign_Occurrence;
|
end Set_Foreign_Occurrence;
|
||||||
|
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
|
@ -835,7 +835,7 @@ package body Freeze is
|
||||||
and then not Has_Independent_Components (T);
|
and then not Has_Independent_Components (T);
|
||||||
|
|
||||||
Packed_Size : Uint := Uint_0;
|
Packed_Size : Uint := Uint_0;
|
||||||
-- SIze in bis so far
|
-- Size in bits so far
|
||||||
|
|
||||||
begin
|
begin
|
||||||
-- Test for variant part present
|
-- Test for variant part present
|
||||||
|
@ -881,11 +881,13 @@ package body Freeze is
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
-- We do not know the packed size if we have a by reference
|
-- 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)
|
if Is_Atomic (Ctyp)
|
||||||
or else Is_Atomic (Comp)
|
or else Is_Atomic (Comp)
|
||||||
or else Is_By_Reference_Type (Ctyp)
|
or else Is_By_Reference_Type (Ctyp)
|
||||||
|
or else Is_Aliased (Comp)
|
||||||
then
|
then
|
||||||
Packed_Size_Known := False;
|
Packed_Size_Known := False;
|
||||||
end if;
|
end if;
|
||||||
|
@ -2529,6 +2531,11 @@ package body Freeze is
|
||||||
-- clause (used to warn about useless Bit_Order pragmas, and also
|
-- clause (used to warn about useless Bit_Order pragmas, and also
|
||||||
-- to detect cases where Implicit_Packing may have an effect).
|
-- 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;
|
All_Scalar_Components : Boolean := True;
|
||||||
-- Set False if we encounter a component of a non-scalar type
|
-- Set False if we encounter a component of a non-scalar type
|
||||||
|
|
||||||
|
@ -2702,6 +2709,9 @@ package body Freeze is
|
||||||
Comp := First_Entity (Rec);
|
Comp := First_Entity (Rec);
|
||||||
Prev := Empty;
|
Prev := Empty;
|
||||||
while Present (Comp) loop
|
while Present (Comp) loop
|
||||||
|
if Is_Aliased (Comp) then
|
||||||
|
Aliased_Component := True;
|
||||||
|
end if;
|
||||||
|
|
||||||
-- Handle the component and discriminant case
|
-- Handle the component and discriminant case
|
||||||
|
|
||||||
|
@ -3203,6 +3213,10 @@ package body Freeze is
|
||||||
|
|
||||||
and then not Placed_Component
|
and then not Placed_Component
|
||||||
|
|
||||||
|
-- Or even one component is aliased
|
||||||
|
|
||||||
|
and then not Aliased_Component
|
||||||
|
|
||||||
-- Must have size clause and all scalar components
|
-- Must have size clause and all scalar components
|
||||||
|
|
||||||
and then Has_Size_Clause (Rec)
|
and then Has_Size_Clause (Rec)
|
||||||
|
|
Loading…
Reference in New Issue