From patchwork Wed Aug 31 09:42:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 112490 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 95A83B6F7F for ; Wed, 31 Aug 2011 19:43:19 +1000 (EST) Received: (qmail 7078 invoked by alias); 31 Aug 2011 09:43:17 -0000 Received: (qmail 7068 invoked by uid 22791); 31 Aug 2011 09:43:16 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 31 Aug 2011 09:43:00 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id DA75A2BB270; Wed, 31 Aug 2011 05:42:59 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id N5vJWk9ic+q1; Wed, 31 Aug 2011 05:42:59 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id B33F62BB26E; Wed, 31 Aug 2011 05:42:59 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id A46073FEE8; Wed, 31 Aug 2011 05:42:59 -0400 (EDT) Date: Wed, 31 Aug 2011 05:42:59 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Thomas Quinot Subject: [Ada] Passing Stream_Element_Offset/Storage_Offset in heterogeneous DSA apps Message-ID: <20110831094259.GA25102@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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 This change ensures that partitions in a DSA application always use a 64 bit representation when exchanging data of type Stream_Element_Offset or Storage_Offset, to avoid interoperability issues between 32- and 64-bit hosts. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-31 Thomas Quinot * rtsfind.ads, exp_dist.adb (Find_Numeric_Representation): Predefined types Stream_Element_Offset and Storage_Offset have a different native type depending on whether the platform is 32 or 64 bits. When exchanging them, always convert to 64 bits. Index: rtsfind.ads =================================================================== --- rtsfind.ads (revision 178371) +++ rtsfind.ads (working copy) @@ -555,6 +555,7 @@ RE_Root_Stream_Type, -- Ada.Streams RE_Stream_Element, -- Ada.Streams + RE_Stream_Element_Offset, -- Ada.Streams RE_Stream_Access, -- Ada.Streams.Stream_IO @@ -1748,6 +1749,7 @@ RE_Root_Stream_Type => Ada_Streams, RE_Stream_Element => Ada_Streams, + RE_Stream_Element_Offset => Ada_Streams, RE_Stream_Access => Ada_Streams_Stream_IO, Index: exp_dist.adb =================================================================== --- exp_dist.adb (revision 178358) +++ exp_dist.adb (working copy) @@ -10842,6 +10842,15 @@ P_Size : constant Uint := Esize (FST); begin + -- Special case: for Stream_Element_Offset and Storage_Offset, + -- always force transmission as a 64-bit value. + + if Is_RTE (FST, RE_Stream_Element_Offset) + or else Is_RTE (FST, RE_Storage_Offset) + then + return RTE (RE_Unsigned_64); + end if; + if Is_Unsigned_Type (Typ) then if P_Size <= 8 then return RTE (RE_Unsigned_8);