diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 973833bd736..63401fbc962 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2012-10-02 Ed Schonberg + + * exp_ch4.adb (Expand_N_Case_Expression): Do not introduce + indirections when the type of the alternatives is an access type: + more efficient, and removes anomalies when an alternative is + statically null. + +2012-10-02 Robert Dewar + + * aspects.ads: Minor comment addition (Invariant is a GNAT aspect). + 2012-10-02 Robert Dewar * exp_ch7.adb, sem_dim.adb, sem_dim.ads, prj-part.adb, checks.adb, diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads index 12e5e6b52c9..3b4ebcedfa7 100644 --- a/gcc/ada/aspects.ads +++ b/gcc/ada/aspects.ads @@ -95,7 +95,7 @@ package Aspects is Aspect_Implicit_Dereference, Aspect_Input, Aspect_Interrupt_Priority, - Aspect_Invariant, + Aspect_Invariant, -- GNAT Aspect_Iterator_Element, Aspect_Link_Name, Aspect_Machine_Radix, diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index c4f662446e1..1bb9d637f63 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -4797,7 +4797,7 @@ package body Exp_Ch4 is -- wrong for unconstrained types (since the bounds may not be the -- same in all branches). Furthermore it involves an extra copy -- for large objects. So we take care of this by using the following - -- modified expansion for non-scalar types: + -- modified expansion for non-elementary types: -- do -- type Pnn is access all typ; @@ -4820,7 +4820,7 @@ package body Exp_Ch4 is -- Scalar case - if Is_Scalar_Type (Typ) then + if Is_Elementary_Type (Typ) then Ttyp := Typ; else @@ -4855,7 +4855,7 @@ package body Exp_Ch4 is -- As described above, take Unrestricted_Access for case of non- -- scalar types, to avoid big copies, and special cases. - if not Is_Scalar_Type (Typ) then + if not Is_Elementary_Type (Typ) then Aexp := Make_Attribute_Reference (Aloc, Prefix => Relocate_Node (Aexp), @@ -4890,7 +4890,7 @@ package body Exp_Ch4 is -- Construct and return final expression with actions - if Is_Scalar_Type (Typ) then + if Is_Elementary_Type (Typ) then Fexp := New_Occurrence_Of (Tnn, Loc); else Fexp :=