From patchwork Mon Nov 6 20:12:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 118097 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3161939qgn; Mon, 6 Nov 2017 12:13:20 -0800 (PST) X-Google-Smtp-Source: ABhQp+SpWKM7xnm57h/9VZ8xAd9DnLj0OjkNhM8o8bpb5SkiDu196CgHjfxhOi/KGc0z4B7SOqlv X-Received: by 10.99.145.73 with SMTP id l70mr16354495pge.132.1509999200081; Mon, 06 Nov 2017 12:13:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509999200; cv=none; d=google.com; s=arc-20160816; b=jG5uYyFzofi5ODDhEFxjFwtnukHa5Vus0bd1AgVs+TBgYgMeZS3QOAahmAuS0SEPF1 0OPHJUJyBRDn3BCbV1BHCyiPDqGoQi+9fcm9CoBmO2MGYdEv+SySVUCZCUQI+bjGMyR+ DktP1yznDp/H56i/z1oT6hl978nLvcBVH3Jwod4ODXNs33x/DIoU7Wb9TeJBy1xXbpt2 GFDb/DJ23DFY+nmh3a9aS7s3chHdekdSnZzNobrGgGAYrf2J9Rm3vtHEzEayiPKRhOaN xxJrAMOf0/ocC0l4iSvBECmG5xhVxM5EpK07D1aI5hAPi7MRNM5L0SFhe85V1epopjG0 Sbtw== 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=sUHqZE3rVHL4WWXIpPGmzMP0Jsf/cV1KtXsg7Lzqd1s=; b=BQLxGxpx7gSkJh62MtiwWmxPHnCpLftIQrb8gQjnBOFmP9u5uiyq2FGWBDwfTFrqqp FadphkLpfW/kbJXD2nTFMTUuaynuuZ4jwaxqb2D/e86hf9msw/97RqO6BuZ/dm0G6xo7 QwuiFjH/HkLwX81oqw6APtvaFJzjOBcswrTQfDz1UHCNxpXs8sKx4iicrTEtSwjSNWyD xQSRy+7Nsz3kTugfmVZ1eBtNQZlD7N4le30gC+hyqixhHGJ6ouf6GHyBMnnQHn/r4HuU 88R5C7gVgR/ESfwskhE+Dss70fLZ5O6c0PQBzKOXeNGhGnlPJp40xTiEfZvYkLAzwSau gNIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=qhTONk2P; spf=pass (google.com: domain of gcc-patches-return-466062-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-466062-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 t61si10575212plb.707.2017.11.06.12.13.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 12:13:20 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-466062-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=qhTONk2P; spf=pass (google.com: domain of gcc-patches-return-466062-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-466062-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=SnZCaooIJFU/+9DzjSxuo8d1Pydv3yC8lQwspvVZ/IOy2mi8tNIO4 /X5f/QXPQczVGsvl1vkhnm4YuJOgkRn0dlJeBrPrJtyAygUT3bg6w6/vNt+K23Os fSo2BS6t48ffLFPZ0u90k8BxMfyP9bk94jPC7lci6xMrXRX6SEMM98= 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=HKGi50hIrTUwKpoAYfyJCtg4urw=; b=qhTONk2PAtMOwKT/6r+e /YkUlTWDxEjHk7ptHQ34qUUipqjzYzhdM4TPCxv7ahsqprnxPDi1Uej69dbItRb9 FvjcQ0QgQRwsz6S7YXikbMstYzSsSDn5rbEyZhYqcW5322wvAibY/orrU66Sw8xx 4h1zMFh1PWWtM2BM35bGJmg= Received: (qmail 62605 invoked by alias); 6 Nov 2017 20:13:05 -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 62594 invoked by uid 89); 6 Nov 2017 20:13:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-16.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr0-f180.google.com Received: from mail-wr0-f180.google.com (HELO mail-wr0-f180.google.com) (209.85.128.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 06 Nov 2017 20:13:03 +0000 Received: by mail-wr0-f180.google.com with SMTP id q66so6197220wrb.13 for ; Mon, 06 Nov 2017 12:13:00 -0800 (PST) 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=sUHqZE3rVHL4WWXIpPGmzMP0Jsf/cV1KtXsg7Lzqd1s=; b=i2QJXbiddE8kK8L3LT93CUmmwciqYCzXFsOKEtWztfusPz66aRLqqg8wBxOj4fcVvI 10Od1KktFc/sUyESSPid9s+Wxxs9hCHyOa1bj1SU+dO/3qL4MMw7S2uPPZVnkFt1IbS3 vdOPjcsdJ5/+em6gQ17+qjdbEN+fqtevCpUQFeTc8fJFYaca78dYTAqEaTz9dU6SfJkT +kwyL6stuOY+kraECpulFE7ZRV8c+TlE7OmGBwH1RhINIu5iTdIpw06Wuh06g0xDo6hX NZoymLlgakEVB0sTlJeCrYn9Szql27ahWlZ8GLH+2TV/0CFNF4R2mTad0+IN9Z84bj/l pYRg== X-Gm-Message-State: AJaThX6ilU4imfoCPk5R0nx7WabpNRHSQWt68HbfT1ZE8HlcnG4qxQNj HrHM/LTP7aKn1volG6ajKbiWXtor/QE= X-Received: by 10.223.157.136 with SMTP id p8mr9766673wre.28.1509999178849; Mon, 06 Nov 2017 12:12:58 -0800 (PST) Received: from localhost ([2.25.234.120]) by smtp.gmail.com with ESMTPSA id x185sm12143638wmx.12.2017.11.06.12.12.57 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2017 12:12:58 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: Non-INTEGER_CST CHREC_RIGHTs in analyze_*_subscript Date: Mon, 06 Nov 2017 20:12:56 +0000 Message-ID: <87h8u7w4hj.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 initialize_matrix_A requires the CHREC_RIGHT to be an INTEGER_CST: switch (TREE_CODE (chrec)) { case POLYNOMIAL_CHREC: A[index][0] = mult * int_cst_value (CHREC_RIGHT (chrec)); return initialize_matrix_A (A, CHREC_LEFT (chrec), index + 1, mult); and isn't able to back out if it isn't. This patch instead checks for an appropriate CHREC_RIGHT before calling the parent function analyze_subscript_affine_affine. Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64-linux-gnu. OK to install? Richard 2017-11-06 Richard Sandiford gcc/ * tree-data-ref.c (analyze_siv_subscript): Only call analyze_subscript_affine_affine on chrecs that have an INTEGER_CST step. (analyze_miv_subscript): Likewise. Index: gcc/tree-data-ref.c =================================================================== --- gcc/tree-data-ref.c 2017-11-06 19:39:32.924734707 +0000 +++ gcc/tree-data-ref.c 2017-11-06 20:10:40.704478657 +0000 @@ -3788,7 +3788,9 @@ analyze_siv_subscript (tree chrec_a, overlaps_b, overlaps_a, last_conflicts); else if (evolution_function_is_affine_in_loop (chrec_a, loop_nest_num) - && evolution_function_is_affine_in_loop (chrec_b, loop_nest_num)) + && evolution_function_right_is_integer_cst (chrec_a) + && evolution_function_is_affine_in_loop (chrec_b, loop_nest_num) + && evolution_function_right_is_integer_cst (chrec_b)) { if (!chrec_contains_symbols (chrec_a) && !chrec_contains_symbols (chrec_b)) @@ -3922,8 +3924,10 @@ analyze_miv_subscript (tree chrec_a, else if (evolution_function_is_affine_multivariate_p (chrec_a, loop_nest->num) && !chrec_contains_symbols (chrec_a) + && evolution_function_right_is_integer_cst (chrec_a) && evolution_function_is_affine_multivariate_p (chrec_b, loop_nest->num) - && !chrec_contains_symbols (chrec_b)) + && !chrec_contains_symbols (chrec_b) + && evolution_function_right_is_integer_cst (chrec_b)) { /* testsuite/.../ssa-chrec-35.c {0, +, 1}_2 vs. {0, +, 1}_3