From patchwork Wed Apr 4 07:36:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 150616 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 7E081B6FF6 for ; Wed, 4 Apr 2012 17:39:09 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1334129949; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:User-Agent:Cc:MIME-Version: Message-Id:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=WG0tB+z7Oy5Ndw5KsztWH0tDw4U=; b=DI2Sl5NcxMH7F79 PClAReG/nT9YISwLTXqCc22AIzP3TrEFSiXB1HgFxJDMIlwE8oI5IOsiVN/8p8+z +tDsGsqWQUHUqlHB6AxMH+PTc5gJragnpoUYfAHAMsCBSvFaAdZH0ksw6bWlvA8d 18hvnzehIA5BHddo2QYGMkjlfW+w= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:From:To:Subject:Date:User-Agent:Cc:MIME-Version:Message-Id:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=QgpUmNRdLDBtjtBlP0s4+aPW3ShhrH7pNnR+SRbuq/zrIzOAWdNSk6O1HmEsya f04pKUV+9XXmWVzgkdoxwg//+6qEujWCheeAfQbFxZL33vZTCOrtmjb4elbU8KFP zq/pxsP6lp/0Wcu/Rl3+AHhYF/Cy/RDhSJuXZij3FXg6M=; Received: (qmail 24797 invoked by alias); 4 Apr 2012 07:39:03 -0000 Received: (qmail 24651 invoked by uid 22791); 4 Apr 2012 07:39:00 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Apr 2012 07:38:41 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 9B493290039; Wed, 4 Apr 2012 09:38:45 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Sq8+Zle27WgH; Wed, 4 Apr 2012 09:38:45 +0200 (CEST) Received: from [192.168.1.2] (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 5DF1129000A; Wed, 4 Apr 2012 09:38:45 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [4.5/Ada] Fix build with 4.6 compiler Date: Wed, 4 Apr 2012 09:36:52 +0200 User-Agent: KMail/1.9.9 Cc: Arnaud Charlet MIME-Version: 1.0 Message-Id: <201204040936.52315.ebotcazou@adacore.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Arno, do you have objections to me applying the attached patch to the 4.5 branch? It makes it possible to build (and bootstrap) the Ada compiler on the 4.5 branch (oldest supported branch) with the 4.6 compiler, which is now the system compiler in recent Linux distributions. The patch backports minor fixes from the 4.6 branch. The only potentially controversial thing is the preprocessor trick in init.c, which arranges for the new symbol __gl_main_cpu not to be added to the runtime. Bootstrapped/regtested with 4.3 and 4.6 compilers on x86 and x86-64/Linux. 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. Index: init.c =================================================================== --- init.c (revision 186078) +++ init.c (working copy) @@ -86,6 +86,9 @@ /* Global values computed by the binder. */ int __gl_main_priority = -1; +#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: types.ads =================================================================== --- types.ads (revision 186078) +++ types.ads (working copy) @@ -125,8 +125,9 @@ 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 @@ -- 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: par-ch3.adb =================================================================== --- par-ch3.adb (revision 186078) +++ par-ch3.adb (working copy) @@ -111,7 +111,6 @@ -- 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 @@ Range_Node : Node_Id; Save_Loc : Source_Ptr; - -- Start of processing for P_Range_Or_Subtype_Mark begin Index: uintp.adb =================================================================== --- uintp.adb (revision 186078) +++ uintp.adb (working copy) @@ -239,7 +239,7 @@ 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; ---------------