From patchwork Wed May 10 14:38:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 760625 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wNJkk1mGBz9s8H for ; Thu, 11 May 2017 00:38:20 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="eGKX7htB"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:cc:content-type; q=dns; s=default; b=gwDkDDpiQK6z7aUKxomriyYyFqEN7UUkdWXJ0o2OyOc q7vxt9JR2Cs4juA2rxG/e76GC37w2qQ9HhcikZcROyN2fQf8Km3KJTcTVvnBGyWY +3tzem4B4mdAeODCSUtHAbj0UGxwtWB0F2D5b5IIhvAw08Jqdxh+c2CzqrXBCC/Q = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:cc:content-type; s=default; bh=xxFUauWE03vwGfFupnC6C+bgYfo=; b=eGKX7htB/3fUW1Pxo ik63HhugBHyG4zq32Zfd/8XdBe/m+AqV2ju4D4CL/opLRJi+rRGPK/W95bta8wDm mTx5RbN97se72yM2xWcVRk+/VySqKoSRjbJjBV6l42PBe/TN6jmGeGs0ExO9qkQK AAqSlghXPVU6oaX1MuiP06pTmA= Received: (qmail 27262 invoked by alias); 10 May 2017 14:38:06 -0000 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 Received: (qmail 27250 invoked by uid 89); 10 May 2017 14:38:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qk0-f178.google.com Received: from mail-qk0-f178.google.com (HELO mail-qk0-f178.google.com) (209.85.220.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 May 2017 14:38:03 +0000 Received: by mail-qk0-f178.google.com with SMTP id u75so31782505qka.3 for ; Wed, 10 May 2017 07:38:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=OgrPYwd+vrFdIHlRA2W9EW1J//Bi+zEJlMUuPnx/3FE=; b=gKtO3LdDoV5pmdMhn3RKA9Wn2NTJM31UHOjTnzg9BfOCsEHOBcKh7Cr/BDCtz09jX8 NCqOEKoiIe/kzMRghKCe8I8uWDNUTuOYia6qcvf072eURf6K4uNOrIUSRt+0hpjO+Dd0 0e23kUHY/2lVxadlhUrdTDfH2e5ooVvz3PmnfYmwllFYkI4t0QcMRsgdAL6j8Jic4jqI 2hfk0XO4H6dpmYlM0gk6aLRXsCIz5gIFfQI1QlwcmPvvnqxy9WbI9FGQEEHblDRP0oG2 /Frl95t/pXTDsvqNCiN+PDhUq4F15FLaT8439nxUxiRDXd1T2eeRq2w4U+6og/49J119 hqcw== X-Gm-Message-State: AODbwcDpP+1tJIVmRM9tyliMZvSSqNrccZgQ+SXSXSeUKlTAfEMSSU69 tgxDy/wPOiQOgWDoY7Br1FixYln5Lg== X-Received: by 10.55.51.146 with SMTP id z140mr6035536qkz.100.1494427084815; Wed, 10 May 2017 07:38:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.115.68 with HTTP; Wed, 10 May 2017 07:38:04 -0700 (PDT) From: "H.J. Lu" Date: Wed, 10 May 2017 07:38:04 -0700 Message-ID: Subject: [PATCH] Ada/x32: PR ada/80626: Correct Memory_Size To: Uros Bizjak Cc: Eric Botcazou , GCC Patches X-IsSubscribed: yes On Tue, May 9, 2017 at 7:32 PM, H.J. Lu wrote: > On Tue, Apr 4, 2017 at 4:46 AM, Andreas Krebbel > wrote: >> On 04/03/2017 06:18 PM, Eric Botcazou wrote: >>>> On S/390 UNITS_PER_WORD is: >>>> 8 with -m64 >>>> 4 with -m31 >>>> 8 with -m31 -mzarch >>>> >>>> This has been chosen to support use of 64 bit registers also in 32 bit >>>> code. Code compiled with -m31 -mzarch is supposed to adhere to the 32 >>>> bit ABI. In order to make that work it was required to prevent >>>> UNITS_PER_WORD from being used in ABI-relevant contexts. That's why >>>> Ulrich added the TARGET_UNWIND_WORD_MODE in 2008 (for SPU). >>> >>> We do that for 32-bit SPARC on Solaris (-mv8plus) but UNITS_PER_WORD is 4. >>> >>>> Now I could either fix this by reverting that change for S/390 >>>> (similiar to what Andreas Schwab did to fix the BZ) or I could just >>>> use the size of the long data type (as we do in the ABI-relevant parts >>>> of the backend as well). Which one do you prefer? >>> >>> Having System.Word_Size != Standard'Word_Size is a bit disturbing. Does it >>> work to change only Memory_Size to 2 ** Long_Integer'Size? This will also >>> correct the definition of Address below. >> >> This worked as well. I've committed the following patch: >> >> gcc/ada/ChangeLog: >> >> 2017-04-04 Andreas Krebbel >> >> * system-linux-s390.ads: Use Long_Integer'Size to define >> Memory_Size. >> --- >> gcc/ada/system-linux-s390.ads | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/gcc/ada/system-linux-s390.ads b/gcc/ada/system-linux-s390.ads >> index 485a8de..9bf8375 100644 >> --- a/gcc/ada/system-linux-s390.ads >> +++ b/gcc/ada/system-linux-s390.ads >> @@ -70,7 +70,7 @@ package System is >> >> Storage_Unit : constant := 8; >> Word_Size : constant := Standard'Word_Size; >> - Memory_Size : constant := 2 ** Word_Size; >> + Memory_Size : constant := 2 ** Long_Integer'Size; >> >> -- Address comparison >> > > X32 needs something similar: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80626 > Here is the patch: X32 uses 64 as word size instead of 32. This must not affect the Address type definition which is based on Memory_Size. PR ada/80626 * system-linux-x86.ads (Memory_Size): Use Long_Integer'Size instead of Word_Size. Tested on x86-64 with -m64/-m32/-mx32. OK for trunk and gcc-7-branch? Thanks. From 813f0651e7c2a506903d0dfd0daff8895c339800 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 10 May 2017 07:31:21 -0700 Subject: [PATCH] Ada/x32: PR ada/80626: Correct Memory_Size X32 uses 64 as word size instead of 32. This must not affect the Address type definition which is based on Memory_Size. PR ada/80626 * system-linux-x86.ads (Memory_Size): Use Long_Integer'Size instead of Word_Size. --- gcc/ada/system-linux-x86.ads | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/system-linux-x86.ads b/gcc/ada/system-linux-x86.ads index 22a212e..533d94e 100644 --- a/gcc/ada/system-linux-x86.ads +++ b/gcc/ada/system-linux-x86.ads @@ -70,7 +70,7 @@ package System is Storage_Unit : constant := 8; Word_Size : constant := Standard'Word_Size; - Memory_Size : constant := 2 ** Word_Size; + Memory_Size : constant := 2 ** Long_Integer'Size; -- Address comparison -- 2.9.3