]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 15 Oct 2013 10:28:02 +0000 (12:28 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 15 Oct 2013 10:28:02 +0000 (12:28 +0200)
2013-10-15  Tristan Gingold  <gingold@adacore.com>

* adaint.c (__gnat_get_executable_load_address): Remove AIX
specific code.

2013-10-15  Ed Schonberg  <schonberg@adacore.com>

* exp_aggr.adb (Aggr_Size_OK): Refine criteria to better handle
large static aggregates with static record components, to avoid
generating a large number of asignments.  Conversely, improve
handling of aggregates initialized by a single association,
which are most efficiently implemented with a loop.

2013-10-15  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_prag.adb (Analyze_Input_Item): Emit an
error when the input item comes from the related package.

2013-10-15  Arnaud Charlet  <charlet@adacore.com>

* exp_ch11.adb (Expand_Exception_Handlers): Restrict previous
change.

From-SVN: r203593

gcc/ada/ChangeLog
gcc/ada/adaint.c
gcc/ada/exp_aggr.adb
gcc/ada/exp_ch11.adb
gcc/ada/sem_prag.adb

index e9fe2cd373f89fc794ce0a121f59058cabb2bdc0..ac5cbb6730deb5b9fa04a34bd8f03d35d5e20eb4 100644 (file)
@@ -1,3 +1,26 @@
+2013-10-15  Tristan Gingold  <gingold@adacore.com>
+
+       * adaint.c (__gnat_get_executable_load_address): Remove AIX
+       specific code.
+
+2013-10-15  Ed Schonberg  <schonberg@adacore.com>
+
+       * exp_aggr.adb (Aggr_Size_OK): Refine criteria to better handle
+       large static aggregates with static record components, to avoid
+       generating a large number of asignments.  Conversely, improve
+       handling of aggregates initialized by a single association,
+       which are most efficiently implemented with a loop.
+
+2013-10-15  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * sem_prag.adb (Analyze_Input_Item): Emit an
+       error when the input item comes from the related package.
+
+2013-10-15  Arnaud Charlet  <charlet@adacore.com>
+
+       * exp_ch11.adb (Expand_Exception_Handlers): Restrict previous
+       change.
+
 2013-10-14  Tristan Gingold  <gingold@adacore.com>
 
        * gcc-interface/gigi.h (standard_datatypes): Add
index e447907095594ad72a9bb19a57b58707f2dd8ae8..3cabec95077c88455a8300a0cdc136607f3e4343 100644 (file)
@@ -3953,8 +3953,6 @@ __gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
 #include <mach-o/dyld.h>
 #elif 0 && defined (__linux__)
 #include <link.h>
-#elif defined (_AIX)
-#include <sys/ldr.h>
 #endif
 
 const void *
@@ -3969,28 +3967,6 @@ __gnat_get_executable_load_address (void)
 
   return (const void *)map->l_addr;
 
-#elif defined (_AIX)
-  /* Unfortunately, AIX wants to return the info for all loaded objects,
-     so we need to increase the buffer if too small.  */
-  size_t blen = 4096;
-  int status;
-
-  while (1)
-    {
-      char buf[blen];
-
-      status = loadquery (L_GETINFO, buf, blen);
-      if (status == 0)
-        {
-          struct ld_info *info = (struct ld_info *)buf;
-          return info->ldinfo_textorg;
-        }
-      blen = blen * 2;
-
-      /* Avoid stack overflow.  */
-      if (blen > 40 * 1024)
-        return (const void *)-1;
-    }
 #else
   return NULL;
 #endif
index e58e5b22f67cf36158b7c64fb4b61a4ddc277ae0..9d72485773bac02eec686086731e2263f267184c 100644 (file)
@@ -376,7 +376,7 @@ package body Exp_Aggr is
    --  Start of processing for Aggr_Size_OK
 
    begin
-      --  The normal aggregate limit is 5000, but we increase this limit to
+      --  The normal aggregate limit is 50000, but we increase this limit to
       --  2**24 (about 16 million) if Restrictions (No_Elaboration_Code) or
       --  Restrictions (No_Implicit_Loops) is specified, since in either case
       --  we are at risk of declaring the program illegal because of this
@@ -389,10 +389,14 @@ package body Exp_Aggr is
       --  efficient to construct a one-dimensional equivalent array with static
       --  components.
 
+      --  Conversely, we decrease the maximum size if none of the above
+      --  requirements apply, and if the aggregate has a single component
+      --  association, which will be more efficient if implemented with a loop.
+
       --  Finally, we use a small limit in CodePeer mode where we favor loops
       --  instead of thousands of single assignments (from large aggregates).
 
-      Max_Aggr_Size := 5000;
+      Max_Aggr_Size := 50000;
 
       if CodePeer_Mode then
          Max_Aggr_Size := 100;
@@ -404,6 +408,11 @@ package body Exp_Aggr is
                  and then Static_Elaboration_Desired (Current_Scope)))
       then
          Max_Aggr_Size := 2 ** 24;
+
+      elsif No (Expressions (N))
+        and then No (Next (First (Component_Associations (N))))
+      then
+         Max_Aggr_Size := 5000;
       end if;
 
       Siz  := Component_Count (Component_Type (Typ));
index c5abb228a17668d7f95086ff07cc8bfd82f6cdb6..90628a05a7956724e1cb2d7a695dc6017c804fb3 100644 (file)
@@ -1029,7 +1029,8 @@ package body Exp_Ch11 is
                --  will insert a call to initialize the choice parameter.
 
                if Present (Choice_Parameter (Handler))
-                 and then Exception_Mechanism /= Back_End_Exceptions
+                 and then (Exception_Mechanism /= Back_End_Exceptions
+                           or else CodePeer_Mode)
                then
                   declare
                      Cparm : constant Entity_Id  := Choice_Parameter (Handler);
index 69df1759b55ba0ff89795f1240a49d8fa47528f2..9e0d2ede1ed468a2634707b4f4b208383f924d82 100644 (file)
@@ -2353,9 +2353,9 @@ package body Sem_Prag is
                   if Ekind_In (Input_Id, E_Abstract_State, E_Variable) then
 
                      --  The input cannot denote states or variables declared
-                     --  within the visible declarations of the package.
+                     --  within the related package.
 
-                     if Contains (States_And_Vars, Input_Id) then
+                     if In_Same_Code_Unit (Item, Input) then
                         Error_Msg_Name_1 := Chars (Pack_Id);
                         Error_Msg_NE
                           ("input item & cannot denote a visible variable or "