From patchwork Sat Nov 2 10:13:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 287963 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CFBB52C0095 for ; Sat, 2 Nov 2013 21:13:39 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=H+A/i+cCWB79antSNRGv2ke7w9/N7KmgRRKR6T3Nl7o1geJ0sw h8qXJ+lbqySHw+aH8OWsHrOtBvZILUqu11e/+DCbeFg2Z4Eksz/S+jDDY2Y56piA 8ZeLqgexmiCvsZwG1TBDQWmzRMQU0ppCMXg0tVET8jVsLYhoL0jZ3aAnY= 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:from :to:cc:subject:date:message-id:mime-version:content-type; s= default; bh=zdohS6Y7GEKfcm6YfF0FWGgxHJY=; b=Rii8dCchVFDZVIkp9BTR imx80Q/Q5Ywj/vmZy870/a+3Op/kY/e7c8TBvt8sQbhWPB2A5y4p1VUgVd0zbsmy ElK9Y1UXtHeIqmyFAqHq07TnKoV87IrSnBt3A3exg9NMZl5jM10pGUcJlEdcBJFA Pxy0tDYmnkuohV3cBHALGnM= Received: (qmail 22807 invoked by alias); 2 Nov 2013 10:13:33 -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 22789 invoked by uid 89); 2 Nov 2013 10:13:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f181.google.com Received: from mail-wi0-f181.google.com (HELO mail-wi0-f181.google.com) (209.85.212.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 02 Nov 2013 10:13:29 +0000 Received: by mail-wi0-f181.google.com with SMTP id ex4so2021666wid.8 for ; Sat, 02 Nov 2013 03:13:26 -0700 (PDT) X-Received: by 10.180.37.227 with SMTP id b3mr5242010wik.24.1383387206847; Sat, 02 Nov 2013 03:13:26 -0700 (PDT) Received: from localhost ([2.28.235.51]) by mx.google.com with ESMTPSA id fr4sm14769299wib.0.2013.11.02.03.13.26 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Sat, 02 Nov 2013 03:13:26 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, zadeck@naturalbridge.com, mikestump@comcast.net, rdsandiford@googlemail.com Cc: zadeck@naturalbridge.com, mikestump@comcast.net Subject: [wide-int] Fix aarch{32,64} builds Date: Sat, 02 Nov 2013 10:13:25 +0000 Message-ID: <87ob63kt6i.fsf@talisman.default> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 I decided to lump these together since the problems were the same. There were some typos in the real_to_integer invocation, while changing: /* There must be no padding. */ if (!host_integerp (TYPE_SIZE (type), 1) || (tree_low_cst (TYPE_SIZE (type), 1) != count * GET_MODE_BITSIZE (*modep))) return -1; to: if (!tree_fits_uhwi_p (TYPE_SIZE (type)) || (tree_to_uhwi (TYPE_SIZE (type)) != count * GET_MODE_BITSIZE (*modep))) return -1; introduced a signed/unsigned warning. Tested on aarch64-linux-gnueabi & arm-linux-gnueabi and applied as obvious. Thanks, Richard Index: gcc/config/aarch64/aarch64.c =================================================================== --- gcc/config/aarch64/aarch64.c (revision 204311) +++ gcc/config/aarch64/aarch64.c (working copy) @@ -6030,9 +6030,7 @@ - tree_to_uhwi (TYPE_MIN_VALUE (index))); /* There must be no padding. */ - if (!tree_fits_uhwi_p (TYPE_SIZE (type)) - || (tree_to_uhwi (TYPE_SIZE (type)) - != count * GET_MODE_BITSIZE (*modep))) + if (wi::ne_p (TYPE_SIZE (type), count * GET_MODE_BITSIZE (*modep))) return -1; return count; @@ -6060,9 +6058,7 @@ } /* There must be no padding. */ - if (!tree_fits_uhwi_p (TYPE_SIZE (type)) - || (tree_to_uhwi (TYPE_SIZE (type)) - != count * GET_MODE_BITSIZE (*modep))) + if (wi::ne_p (TYPE_SIZE (type), count * GET_MODE_BITSIZE (*modep))) return -1; return count; @@ -6092,9 +6088,7 @@ } /* There must be no padding. */ - if (!tree_fits_uhwi_p (TYPE_SIZE (type)) - || (tree_to_uhwi (TYPE_SIZE (type)) - != count * GET_MODE_BITSIZE (*modep))) + if (wi::ne_p (TYPE_SIZE (type), count * GET_MODE_BITSIZE (*modep))) return -1; return count; @@ -7433,7 +7427,7 @@ int exponent; unsigned HOST_WIDE_INT mantissa, mask; REAL_VALUE_TYPE r, m; - bool &fail + bool fail; if (!CONST_DOUBLE_P (x)) return false; @@ -7457,7 +7451,7 @@ WARNING: If we ever have a representation using more than 2 * H_W_I - 1 bits for the mantissa, this can fail (low bits will be lost). */ real_ldexp (&m, &r, point_pos - exponent); - w = real_to_integer (m, &fail, HOST_BITS_PER_WIDE_INT * 2); + wide_int w = real_to_integer (&m, &fail, HOST_BITS_PER_WIDE_INT * 2); /* If the low part of the mantissa has bits set we cannot represent the value. */ Index: gcc/config/arm/arm.c =================================================================== --- gcc/config/arm/arm.c (revision 204311) +++ gcc/config/arm/arm.c (working copy) @@ -4678,9 +4678,7 @@ - tree_to_uhwi (TYPE_MIN_VALUE (index))); /* There must be no padding. */ - if (!tree_fits_uhwi_p (TYPE_SIZE (type)) - || (tree_to_uhwi (TYPE_SIZE (type)) - != count * GET_MODE_BITSIZE (*modep))) + if (wi::ne_p (TYPE_SIZE (type), count * GET_MODE_BITSIZE (*modep))) return -1; return count; @@ -4708,9 +4706,7 @@ } /* There must be no padding. */ - if (!tree_fits_uhwi_p (TYPE_SIZE (type)) - || (tree_to_uhwi (TYPE_SIZE (type)) - != count * GET_MODE_BITSIZE (*modep))) + if (wi::ne_p (TYPE_SIZE (type), count * GET_MODE_BITSIZE (*modep))) return -1; return count; @@ -4740,9 +4736,7 @@ } /* There must be no padding. */ - if (!tree_fits_uhwi_p (TYPE_SIZE (type)) - || (tree_to_uhwi (TYPE_SIZE (type)) - != count * GET_MODE_BITSIZE (*modep))) + if (wi::ne_p (TYPE_SIZE (type), count * GET_MODE_BITSIZE (*modep))) return -1; return count; @@ -11299,7 +11293,7 @@ WARNING: If there's ever a VFP version which uses more than 2 * H_W_I - 1 bits for the mantissa, this may fail (low bits would be lost). */ real_ldexp (&m, &r, point_pos - exponent); - wide_int w = real_to_integer (m, &fail, HOST_BITS_PER_WIDE_INT * 2); + wide_int w = real_to_integer (&m, &fail, HOST_BITS_PER_WIDE_INT * 2); mantissa = w.elt (0); mant_hi = w.elt (1);