]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 15 Apr 2009 12:18:14 +0000 (14:18 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 15 Apr 2009 12:18:14 +0000 (14:18 +0200)
2009-04-15  Robert Dewar  <dewar@adacore.com>

* 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  <schonberg@adacore.com>

* 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.

From-SVN: r146104

gcc/ada/ChangeLog
gcc/ada/exp_ch6.adb
gcc/ada/sem_eval.adb
gcc/ada/targparm.adb

index 5d97326a457ea0ace5b04ae71eb53aeb1b517964..23d1a3e2ca3562a5d6c17a152e4bb5cdffa21806 100644 (file)
@@ -1,3 +1,17 @@
+2009-04-15  Robert Dewar  <dewar@adacore.com>
+
+       * 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  <schonberg@adacore.com>
+
+       * 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  <dewar@adacore.com>
 
        * rtsfind.adb: Minor reformatting.
index 4bab3d2694b6ee72a3f60036139c203d8a65d70f..edb08c37b7d87c21219fb5f55e9a454d9b545cde 100644 (file)
@@ -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,
index 2edcd0ec8dbf174112c9142976cf2c557dee759f..596b4aff1be10adf98e536c26f47b3eae3e0dce0 100644 (file)
@@ -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
index 52bbbcb953cfe7144189693eb90e3f442180aae2..da42ba8b7b5ae611b62277320fce462bece68480 100644 (file)
@@ -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;