From: Eric Botcazou Date: Wed, 4 Apr 2012 08:21:00 +0000 (+0000) Subject: backport: init.c (__gl_main_cpu): New global variable. X-Git-Tag: releases/gcc-4.5.4~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a99c39eb74163f118144ff78a204f7c724492049;p=thirdparty%2Fgcc.git backport: init.c (__gl_main_cpu): New global variable. 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 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d80ac672a290..e44a3dd8500a 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,12 @@ +2012-04-04 Eric Botcazou + + 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 PR ada/46192 diff --git a/gcc/ada/init.c b/gcc/ada/init.c index 28498c428a52..b1edfb05f788 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -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 = ' '; diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index 1b2683379e3d..988fb06565a9 100644 --- a/gcc/ada/par-ch3.adb +++ b/gcc/ada/par-ch3.adb @@ -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 diff --git a/gcc/ada/types.ads b/gcc/ada/types.ads index cc3603aafa08..df19e44aeb0b 100644 --- a/gcc/ada/types.ads +++ b/gcc/ada/types.ads @@ -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 diff --git a/gcc/ada/uintp.adb b/gcc/ada/uintp.adb index 933772191758..af470f8523fd 100644 --- a/gcc/ada/uintp.adb +++ b/gcc/ada/uintp.adb @@ -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; ---------------