From patchwork Sun Oct 22 20:13:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 116634 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3929307qgn; Sun, 22 Oct 2017 13:13:33 -0700 (PDT) X-Received: by 10.98.16.81 with SMTP id y78mr10724024pfi.114.1508703213557; Sun, 22 Oct 2017 13:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508703213; cv=none; d=google.com; s=arc-20160816; b=mFDu9CvIaBcJgQWYFF3pvoQPsCGTc2Kvy+9WRgmDJkVodvurXe6w4SKibojHZZFb1w 9PiykMJJXDdGKND45R9pQl8336ZjrvDvbYgFCGOW0lc02nhM1DzgpEOUFCQojNyastFh Z5oYkxqCLOICpRVhl3JEAmKxhBCC5G0PpI/3aykseCOCabKUPH3Rc7H1WI5UX+h0u/v2 MgzImToxBgmfcOJ+SvXVNcfN6PErzoUCQSMYKdlVjsSH+ICop2s0hoJQQEhT/FE8ces5 8GK+geCaZ76MlhU5MYO0G1GK83J3ARHmwa/N82e7OeD/B03ylTHNGjQPR+/22dJxsSf6 nZDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:date:subject:mail-followup-to:to :from:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=DbHxQIRGY53s/r69q8JprhtIv4ysdULcLmLBGZ4ImQA=; b=c7sUhxb20g+AapN0IpYnZ0bSwNH20HHr9O3w+/45NvUekm7iVFaqEL+cP51YdE14EF OVa9x0dcyGEGIdITf7bZNF/t5GSxUkCugiYLtmTjVRe+9cPygREg7LYXn6AN77U3kMHB /Ern2NoeihQ2gEV0BPN7KH5gP1QuuQ8j2FhiYNs4iWrxfFPWJ7UyCsCVUgmoOwoovHv3 HnVG+VtpAhx3WPxXu2sVyPfS35XuKiwawtUJ0rtLibJx1GzwW6bStZfUdc2DMYwb/K4D SrWRfRTeGHNX+RFDN+JmEznBGxnV/vqpYDp2LRoexMnc05xXWIO3kEGj5BpYzDCYRugi /zog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=eKsTQr/+; spf=pass (google.com: domain of gcc-patches-return-464692-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464692-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id z33si3184657plb.555.2017.10.22.13.13.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Oct 2017 13:13:33 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-464692-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=eKsTQr/+; spf=pass (google.com: domain of gcc-patches-return-464692-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464692-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=IWaKjS+dKm9hra/0eRM/Ix7PLFXSNfZOAEe1Pfg8FoNZxNri1v0iF 0EIAk6SfPUNcwMDNQdKavggzo6sOJobLPnTTCwS9gwuVGs0N1pLeWbNw7N8IOL+0 NnCfi0/kcH5tsyHrPe565CZXgp5eJmGIkuG2tRRNtBO1qD9xGijCqc= 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:subject:date:message-id:mime-version:content-type; s= default; bh=bDnqfwCltdPUd8Uyycq7UoB4Rpw=; b=eKsTQr/+OFHyacsUzT29 cNO1fwPfIT09WxXKo4TxpDjxbZ2wV5ZgQcGd8Gg8WkMAHgW7I8F1jsHABFi9beja jl8sELYjh/xSDxImu6j9pB6Ev1c9m5egltiCTVg+ss6iPiGuHAFQp8rML+YpfpAA ISXL9QaQWSkA6gu7WFPLDkg= Received: (qmail 129300 invoked by alias); 22 Oct 2017 20:13:19 -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 128363 invoked by uid 89); 22 Oct 2017 20:13:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f49.google.com Received: from mail-wm0-f49.google.com (HELO mail-wm0-f49.google.com) (74.125.82.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 22 Oct 2017 20:13:17 +0000 Received: by mail-wm0-f49.google.com with SMTP id b9so507180wmh.0 for ; Sun, 22 Oct 2017 13:13:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:date:message-id :user-agent:mime-version; bh=DbHxQIRGY53s/r69q8JprhtIv4ysdULcLmLBGZ4ImQA=; b=calWXjn+PwNTI0A9UG7UZ82m0Tho2gLgz+dgvCjGBNguiCkLcpZwwYJ7ftQ05UNsag 2lVMmXCOuTpw560gFX82/tTtxUHhxEXaFN8jvHhbZy6DbaoRRidpnlFCJeDWr6IlRQ/3 zDdeYJGQKf+XEYNvsI+7Y2RAnU3avH1iHRc/YB8sqlgzna9aUhUebTwaW6HPldwthnFl MhlsuLaTspieHs+bJis2shoXb2nAWx0oTZpTL/R7CN10FASwGvE/kr7zHg6+S8ELXXsZ C0kYBPpGwPxWS5WTtkkz2JP/zi+uxRQURD8zGcvXGrTHCUck7ZiHbXL3vFe9mjX4K38k IVHg== X-Gm-Message-State: AMCzsaVpKCsaEGlp6/nMAtpmDVAEMqhhuRgv2Ne3WXkS7mUkzF3opbAz K1u/+rHeFD0xxI8bsXx/fqyI78au7lQ= X-Google-Smtp-Source: ABhQp+SwIz3NfaQs0GQ9LbCPXRGbiOw7Rw0bQ5mbVJsmzidZWEtWkBGcHutA6Pm/8eKwqqXV0x7xHw== X-Received: by 10.28.69.8 with SMTP id s8mr3219261wma.65.1508703194759; Sun, 22 Oct 2017 13:13:14 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id h185sm8468997wma.19.2017.10.22.13.13.13 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Oct 2017 13:13:13 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: Fix HWI + -unsigned in combine.c Date: Sun, 22 Oct 2017 21:13:11 +0100 Message-ID: <87tvyrym94.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 rtx_equal_for_field_assignment_p had: x = adjust_address_nv (x, GET_MODE (y), -subreg_lowpart_offset (GET_MODE (x), GET_MODE (y))); But subreg_lowpart_offset returns an unsigned int and adjust_address_nv takes a HWI, so a subreg offset of 4 would give a memory offset of 0x00000000fffffffffc. The SVE series makes this go away by using HWI-based types for both interfaces, but in this case the fix is also a minor clean-up. Tested on aarch64-linux-gnu, powerpc64le-linux-gnu and x86_64-linux-gnu. OK to install? Richard 2017-10-22 Richard Sandiford gcc/ * combine.c (rtx_equal_for_field_assignment_p): Use byte_lowpart_offset. Index: gcc/combine.c =================================================================== --- gcc/combine.c 2017-10-22 21:04:50.138830154 +0100 +++ gcc/combine.c 2017-10-22 21:04:59.000825360 +0100 @@ -9526,13 +9526,9 @@ rtx_equal_for_field_assignment_p (rtx x, return 0; if (BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN) return 0; - /* For big endian, adjust the memory offset. */ - if (BYTES_BIG_ENDIAN) - x = adjust_address_nv (x, GET_MODE (y), - -subreg_lowpart_offset (GET_MODE (x), - GET_MODE (y))); - else - x = adjust_address_nv (x, GET_MODE (y), 0); + x = adjust_address_nv (x, GET_MODE (y), + byte_lowpart_offset (GET_MODE (y), + GET_MODE (x))); } if (x == y || rtx_equal_p (x, y))