]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: init.c (__gl_main_cpu): New global variable.
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 4 Apr 2012 08:21:00 +0000 (08:21 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 4 Apr 2012 08:21:00 +0000 (08:21 +0000)
Backport from 4.6 branch
* init.c (__gl_main_cpu): New global variable.
* par-ch3.adb: Remove a couple of blank lines.
* types.ads (Big_String_Ptr): Don't give it zero storage size.
(Source_Buffer_Ptr): Likewise.
* uintp.adb (Hash_Num): Use "mod" operator from Types.

From-SVN: r186132

gcc/ada/ChangeLog
gcc/ada/init.c
gcc/ada/par-ch3.adb
gcc/ada/types.ads
gcc/ada/uintp.adb

index d80ac672a29087ceb783d65df0d0e0f1ffdaeb91..e44a3dd8500a8cae5e6f94304e80553a98b215dc 100644 (file)
@@ -1,3 +1,12 @@
+2012-04-04  Eric Botcazou  <ebotcazou@adacore.com>
+
+       Backport from 4.6 branch
+       * init.c (__gl_main_cpu): New global variable.
+       * par-ch3.adb: Remove a couple of blank lines.
+       * types.ads (Big_String_Ptr): Don't give it zero storage size.
+       (Source_Buffer_Ptr): Likewise.
+       * uintp.adb (Hash_Num): Use "mod" operator from Types.
+
 2012-01-21  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR ada/46192
index 28498c428a52cbee4654e08b82d31699d7c7b41f..b1edfb05f78866d2e60994f908876f8c34eb7c6f 100644 (file)
@@ -86,6 +86,11 @@ extern void Raise_From_Signal_Handler (struct Exception_Data *, const char *);
 
 /* Global values computed by the binder.  */
 int   __gl_main_priority                 = -1;
+/* ??? This is needed to build the compiler with a 4.6 compiler, which is not
+   really supported but happens to essentially work except for this nit.  */
+#if (__GNUC__ * 10 + __GNUC_MINOR__ > 45)
+int   __gl_main_cpu                      = -1;
+#endif
 int   __gl_time_slice_val                = -1;
 char  __gl_wc_encoding                   = 'n';
 char  __gl_locking_policy                = ' ';
index 1b2683379e3dcebde14015f7ba2a15802e802d8d..988fb06565a98b609b59655252b7090da73cadf3 100644 (file)
@@ -111,7 +111,6 @@ package body Ch3 is
    --  current token, and if this is the first such message issued, saves
    --  the message id in Missing_Begin_Msg, for possible later replacement.
 
-
    ---------------------------------
    -- Check_Restricted_Expression --
    ---------------------------------
@@ -2107,7 +2106,6 @@ package body Ch3 is
       Range_Node : Node_Id;
       Save_Loc   : Source_Ptr;
 
-
    --  Start of processing for P_Range_Or_Subtype_Mark
 
    begin
index cc3603aafa080ed94871d2f995db6b4a03db56a2..df19e44aeb0be7466173478450b236d00eafa01b 100644 (file)
@@ -125,8 +125,9 @@ package Types is
 
    subtype Big_String is String (Positive);
    type Big_String_Ptr is access all Big_String;
-   for Big_String_Ptr'Storage_Size use 0;
-   --  Virtual type for handling imported big strings
+   --  Virtual type for handling imported big strings. Note that we should
+   --  never have any allocators for this type, but we don't give a storage
+   --  size of zero, since there are legitimate deallocations going on.
 
    function To_Big_String_Ptr is
      new Unchecked_Conversion (System.Address, Big_String_Ptr);
@@ -200,13 +201,14 @@ package Types is
    --  Source_Buffer_Ptr, see Osint.Read_Source_File for details.
 
    type Source_Buffer_Ptr is access all Big_Source_Buffer;
-   for Source_Buffer_Ptr'Storage_Size use 0;
    --  Pointer to source buffer. We use virtual origin addressing for source
    --  buffers, with thin pointers. The pointer points to a virtual instance
    --  of type Big_Source_Buffer, where the actual type is in fact of type
    --  Source_Buffer. The address is adjusted so that the virtual origin
    --  addressing works correctly. See Osint.Read_Source_Buffer for further
-   --  details.
+   --  details. Again, as for Big_String_Ptr, we should never allocate using
+   --  this type, but we don't give a storage size clause of zero, since we
+   --  may end up doing deallocations of instances allocated manually.
 
    subtype Source_Ptr is Text_Ptr;
    --  Type used to represent a source location, which is a subscript of a
index 93377219175812292875dd7660cd1f6225acb210..af470f8523fd19f6737092fbf8141f0b703d6e7a 100644 (file)
@@ -239,7 +239,7 @@ package body Uintp is
 
    function Hash_Num (F : Int) return Hnum is
    begin
-      return Standard."mod" (F, Hnum'Range_Length);
+      return Types."mod" (F, Hnum'Range_Length);
    end Hash_Num;
 
    ---------------