diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5d97326a457e..23d1a3e2ca35 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,17 @@ +2009-04-15 Robert Dewar + + * sem_eval.adb (Get_Static_Length): Go to origin node for array bounds + in case they were rewritten by expander (Force_Evaluation). + + * targparm.adb (Get_Target_Parameters): Correct check for + Suppress_Exception_Locations. + +2009-04-15 Ed Schonberg + + * exp_ch6.adb (Expand_Inlined_Call): If an in-parameter in a call to be + inlined is of an array type that is not bit-packed, use a renaming + declaration to capture its value, rather than a constant declaration. + 2009-04-15 Robert Dewar * rtsfind.adb: Minor reformatting. diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 4bab3d2694b6..edb08c37b7d8 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -3795,9 +3795,18 @@ package body Exp_Ch6 is -- its value is captured in a renaming declaration. Otherwise -- declare a local constant initialized with the actual. + -- We also use a renaming declaration for expressions of an + -- array type that is not bit-packed, both for efficiency reasons + -- and to respect the semantics of the call: in most cases the + -- original call will pass the parameter by reference, and thus + -- the inlined code will have the same semantics. + if Ekind (F) = E_In_Parameter and then not Is_Limited_Type (Etype (A)) and then not Is_Tagged_Type (Etype (A)) + and then + (not Is_Array_Type (Etype (A)) + or else Is_Bit_Packed_Array (Etype (A))) then Decl := Make_Object_Declaration (Loc, diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index 2edcd0ec8dbf..596b4aff1be1 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -2504,8 +2504,10 @@ package body Sem_Eval is -- Start of processing for Extract_Length begin - Decompose_Expr (Type_Low_Bound (T), Ent1, Kind1, Cons1); - Decompose_Expr (Type_High_Bound (T), Ent2, Kind2, Cons2); + Decompose_Expr + (Original_Node (Type_Low_Bound (T)), Ent1, Kind1, Cons1); + Decompose_Expr + (Original_Node (Type_High_Bound (T)), Ent2, Kind2, Cons2); if Present (Ent1) and then Kind1 = Kind2 diff --git a/gcc/ada/targparm.adb b/gcc/ada/targparm.adb index 52bbbcb953cf..da42ba8b7b5a 100644 --- a/gcc/ada/targparm.adb +++ b/gcc/ada/targparm.adb @@ -408,10 +408,10 @@ package body Targparm is -- Suppress_Exception_Locations - elsif System_Text (P .. P + 34) = - "pragma Suppress_Exception_Locations;" + elsif System_Text (P .. P + 35) = + "pragma Suppress_Exception_Locations;" then - P := P + 35; + P := P + 36; Opt.Exception_Locations_Suppressed := True; goto Line_Loop_Continue;