[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 2 Jan 2013 09:34:50 +0000 (10:34 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 2 Jan 2013 09:34:50 +0000 (10:34 +0100)
2013-01-02  Thomas Quinot  <quinot@adacore.com>

* exp_prag.adb: Minor reformatting.

2013-01-02  Ed Schonberg  <schonberg@adacore.com>

* sem_ch12.adb (Get_Associated_Node): If the node is an
identifier that denotes an unconstrained array in an object
declaration, it is rewritten as the name of an anonymous
subtype whose bounds are given by the initial expression in the
declaration. When checking whether that identifier is global
reference, use the original node, not the local generated subtype.

2013-01-02  Olivier Hainque  <hainque@adacore.com>

* tracebak.c: Revert previous change, incomplete.

2013-01-02  Ed Schonberg  <schonberg@adacore.com>

* sem_ch13.adb (Analyze_Aspect_Specifications): If the aspect
appears on a subprogram body that acts as a spec, place the
corresponding pragma in the declarations of the body, so that
e.g. pre/postcondition checks can be generated appropriately.

2013-01-02  Robert Dewar  <dewar@adacore.com>

* sem_ch3.adb: Minor reformatting and code reorganization.

From-SVN: r194781

gcc/ada/ChangeLog
gcc/ada/exp_prag.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch3.adb
gcc/ada/tracebak.c

index 66c03a0811268d8543f0766148e3f78fc8504c74..7d79a90658ad5885cac9021108240c5efd0faa0c 100644 (file)
@@ -1,3 +1,31 @@
+2013-01-02  Thomas Quinot  <quinot@adacore.com>
+
+       * exp_prag.adb: Minor reformatting.
+
+2013-01-02  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch12.adb (Get_Associated_Node): If the node is an
+       identifier that denotes an unconstrained array in an object
+       declaration, it is rewritten as the name of an anonymous
+       subtype whose bounds are given by the initial expression in the
+       declaration. When checking whether that identifier is global
+       reference, use the original node, not the local generated subtype.
+
+2013-01-02  Olivier Hainque  <hainque@adacore.com>
+
+       * tracebak.c: Revert previous change, incomplete.
+
+2013-01-02  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch13.adb (Analyze_Aspect_Specifications): If the aspect
+       appears on a subprogram body that acts as a spec, place the
+       corresponding pragma in the declarations of the body, so that
+       e.g. pre/postcondition checks can be generated appropriately.
+
+2013-01-02  Robert Dewar  <dewar@adacore.com>
+
+       * sem_ch3.adb: Minor reformatting and code reorganization.
+
 2013-01-02  Vincent Celier  <celier@adacore.com>
 
        * switch-m.adb (Normalize_Compiler_Switches): Record the
index d34322dc6269e1384b15961712d02f7e2d6e0efe..9ff1318345cf726dfae40ef934dc31414e35e316 100644 (file)
@@ -274,8 +274,8 @@ package body Exp_Prag is
    --------------------------
 
    procedure Expand_Pragma_Check (N : Node_Id) is
-      Cond : constant Node_Id    := Arg2 (N);
-      Nam  : constant Name_Id    := Chars (Arg1 (N));
+      Cond : constant Node_Id := Arg2 (N);
+      Nam  : constant Name_Id := Chars (Arg1 (N));
       Msg  : Node_Id;
 
       Loc  : constant Source_Ptr := Sloc (First_Node (Cond));
index 10718c4ec3f9c362525be4a6c23d584a83a82662..b90a7af19d28727d4bfb1fa750050606d3f52962 100644 (file)
@@ -4929,6 +4929,17 @@ package body Sem_Ch12 is
             Assoc := Associated_Node (Assoc);
          end if;
 
+         --  An additional special case: an unconstrained type in an object
+         --  declaration may have been rewritten as a local subtype constrained
+         --  by the expression in the declaration. We need to recover the
+         --  original entity which may be global.
+
+         if Present (Original_Node (Assoc))
+           and then Nkind (Parent (N)) = N_Object_Declaration
+         then
+            Assoc := Original_Node (Assoc);
+         end if;
+
          return Assoc;
       end if;
    end Get_Associated_Node;
index 38be20c7426cac7ce553752af069455afbd1ffef..a959e51a86272ccc2b71fb168b43f015cb99a488 100644 (file)
@@ -1606,6 +1606,17 @@ package body Sem_Ch13 is
 
                   if Nkind (Parent (N)) = N_Compilation_Unit then
                      Add_Global_Declaration (Aitem);
+
+                  --  If it is a subprogram body, add pragmas to list of
+                  --  declarations in body.
+
+                  elsif Nkind (N) = N_Subprogram_Body then
+                     if No (Declarations (N)) then
+                        Set_Declarations (N, New_List);
+                     end if;
+
+                     Append (Aitem, Declarations (N));
+
                   else
                      Insert_After (N, Aitem);
                   end if;
index 451873a21ae1960be3a4d573f6b3472e63d73c94..2308234f9e9b78b4cbb5997590d1d6597e0d906b 100644 (file)
@@ -13633,7 +13633,7 @@ package body Sem_Ch3 is
 
       Alias_Subp   : Entity_Id;
       Act_List     : Elist_Id;
-      Act_Elmt     : Elmt_Id   := No_Elmt;
+      Act_Elmt     : Elmt_Id;
       Act_Subp     : Entity_Id := Empty;
       Elmt         : Elmt_Id;
       Need_Search  : Boolean   := False;
@@ -13656,6 +13656,9 @@ package body Sem_Ch3 is
       if Present (Generic_Actual) then
          Act_List := Collect_Primitive_Operations (Generic_Actual);
          Act_Elmt := First_Elmt (Act_List);
+      else
+         Act_List := No_Elist;
+         Act_Elmt := No_Elmt;
       end if;
 
       --  Derive primitives inherited from the parent. Note that if the generic
@@ -13850,15 +13853,17 @@ package body Sem_Ch3 is
                      pragma Assert
                        (Is_Generic_Unit
                           (Scope (Find_Dispatching_Type (Alias_Subp)))
-                       or else
-                        Instantiation_Depth
-                          (Sloc (Find_Dispatching_Type (Alias_Subp))) > 0);
+                         or else
+                           Instantiation_Depth
+                             (Sloc (Find_Dispatching_Type (Alias_Subp))) > 0);
 
                      declare
                         Iface_Prim_Loc : constant Source_Ptr :=
                                          Original_Location (Sloc (Alias_Subp));
-                        Elmt      : Elmt_Id;
-                        Prim      : Entity_Id;
+
+                        Elmt : Elmt_Id;
+                        Prim : Entity_Id;
+
                      begin
                         Elmt :=
                           First_Elmt (Primitive_Operations (Generic_Actual));
@@ -13868,8 +13873,8 @@ package body Sem_Ch3 is
 
                            if Present (Interface_Alias (Prim))
                              and then Original_Location
-                                        (Sloc (Interface_Alias (Prim)))
-                                       = Iface_Prim_Loc
+                                        (Sloc (Interface_Alias (Prim))) =
+                                                              Iface_Prim_Loc
                            then
                               Act_Subp := Alias (Prim);
                               exit Search;
index 01b96548baf9b4dc6409173d0d457510bb5833b4..2c8335de68b16e585eed6f2fd7714b1553cb4f5b 100644 (file)
@@ -287,10 +287,9 @@ __gnat_backtrace (void **array,
 #error Unhandled darwin architecture.
 #endif
 
-/*---------------------- PPC AIX/PPC Lynx 178/Older Darwin ------------------*/
+/*------------------------ PPC AIX/Older Darwin -------------------------*/
 #elif ((defined (_POWER) && defined (_AIX)) || \
-       (defined (__powerpc__) && defined (__Lynx__) && !defined(__ELF__)) || \
-       (defined (__ppc__) && defined (__APPLE__)))
+(defined (__ppc__) && defined (__APPLE__)))
 
 #define USE_GENERIC_UNWINDER
 
@@ -308,23 +307,9 @@ struct layout
    should to feature a null backchain, AIX might expose a null return
    address instead.  */
 
-/* Then LynxOS-178 features yet another variation, with return_address
-   == &__start, which we only add conditionally as this symbol is not
-   necessarily present elsewhere.  Beware that &bla returns the
-   address of a descriptor when "bla" is a function.  Getting the code
-   address requires an extra dereference.  */
-
-#if defined (__Lynx__)
-extern void __start();
-#define EXTRA_STOP_CONDITION(CURRENT) ((CURRENT)->return_address == *(void**)&__start)
-#else
-#define EXTRA_STOP_CONDITION(CURRENT) (0)
-#endif
-
 #define STOP_FRAME(CURRENT, TOP_STACK) \
   (((void *) (CURRENT) < (TOP_STACK)) \
-   || (CURRENT)->return_address == NULL \
-   || EXTRA_STOP_CONDITION(CURRENT))
+   || (CURRENT)->return_address == NULL)
 
 /* The PPC ABI has an interesting specificity: the return address saved by a
    function is located in it's caller's frame, and the save operation only