From patchwork Mon Apr 3 14:23:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 746490 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 3vxZ8z20Gdz9s83 for ; Tue, 4 Apr 2017 00:23:46 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Sq6+8g0W"; 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:date :from:to:cc:subject:mime-version:content-type:message-id; q=dns; s=default; b=HkPITi9N+Z37NOrulkYM508ilyqUCDbCZ8LRZ/a3cK3MEHId4T Vcw9xLQx6rv3K7DZvTZr3YYmQUDJ9TckTcH01N4rIIbOQJjwOxKGtdRYywz9d069 gYBJI4tUdpxyAfFb3TdOzMHLUxIYe7ctFE8AY2QsfTch3cxQb9oArcLhY= 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:date :from:to:cc:subject:mime-version:content-type:message-id; s= default; bh=Be0K+8Q2A23dGJppG6LlKu5HEpo=; b=Sq6+8g0WJX2C9D1pjFU7 gveayDldqhVf9VVc7sEgwRUIu56UBtW+foyCNgPDJ14yYP0WduX33+uLHgSOBBnA R1Og6Yyq+BpdlHiRa3qMBq2o46elaXgdlxqMlAjbMhTfcNyfg/pm45R8cGT4Jsc6 DdaGK3fuSQD4F/8CVPugQ78= Received: (qmail 54043 invoked by alias); 3 Apr 2017 14:23:36 -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 54026 invoked by uid 89); 3 Apr 2017 14:23:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=H*r:sendmail, H*r:emulation, H*o:Research, H*r:sSMTP X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Apr 2017 14:23:33 +0000 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v33EJ5ZG189918 for ; Mon, 3 Apr 2017 10:23:33 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 29kqbmk517-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 03 Apr 2017 10:23:33 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 3 Apr 2017 15:23:31 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 3 Apr 2017 15:23:29 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v33ENTXP28115032; Mon, 3 Apr 2017 14:23:29 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DC752AE055; Mon, 3 Apr 2017 15:22:40 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C2579AE045; Mon, 3 Apr 2017 15:22:39 +0100 (BST) Received: from bart (unknown [9.152.212.134]) by d06av26.portsmouth.uk.ibm.com (Postfix) with SMTP; Mon, 3 Apr 2017 15:22:39 +0100 (BST) Received: by bart (sSMTP sendmail emulation); Mon, 03 Apr 2017 16:23:27 +0200 Date: Mon, 3 Apr 2017 16:23:27 +0200 From: Andreas Krebbel To: ebotcazou@adacore.com Cc: gcc-patches@gcc.gnu.org Subject: [RFC]: Fix Ada boostrap failure on S/390 with -mzarch MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17040314-0040-0000-0000-0000035C58C2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17040314-0041-0000-0000-000024CAF148 Message-Id: <20170403142327.GA29110@maggie> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-03_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1704030129 X-IsSubscribed: yes Hi Eric, I ran into a similiar problem as PR80117 on S/390 starting with your patch merging the system*.ads files for some biarch plattforms. Starting with that change GCC does not bootstrap on S/390 when configured with --with-mode=zarch. 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). More target hooks were needed for UNITS_PER_WORD uses in libgcc: TARGET_LIBGCC_CMP_RETURN_MODE, and TARGET_LIBGCC_SHIFT_COUNT_MODE. The use of the UNITS_PER_WORD in the system.ads files looks like adding another ABI/API-relevant use to me. 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? Bye, -Andreas- diff --git a/gcc/ada/system-linux-s390.ads b/gcc/ada/system-linux-s390.ads index 485a8de..144c46d 100644 --- a/gcc/ada/system-linux-s390.ads +++ b/gcc/ada/system-linux-s390.ads @@ -69,7 +69,7 @@ package System is Null_Address : constant Address; Storage_Unit : constant := 8; - Word_Size : constant := Standard'Word_Size; + Word_Size : constant := Long_Integer'Size; Memory_Size : constant := 2 ** Word_Size; -- Address comparison