From patchwork Thu Dec 28 20:40:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 122873 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3896809qgn; Thu, 28 Dec 2017 12:40:49 -0800 (PST) X-Google-Smtp-Source: ACJfBos9SGpDNKd0tgat61ZjI8ulfKliyfKaUd0I72GgAMTpr6ZcOpLGVCVZTi6tDnFjGzbPs1V+ X-Received: by 10.159.196.130 with SMTP id c2mr33345556plo.123.1514493649851; Thu, 28 Dec 2017 12:40:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514493649; cv=none; d=google.com; s=arc-20160816; b=slRmgGbM5C47s9xOnXmu/vtbEBCduM4NeY970uMt1rA6Q8D0LJJ0PnPC/F7CbibBBL MV0lsQ0crvKinpDh46Os7HWFpNy8lBuCk1UDw9At2hlSi+YCDo0pRX87sn9DQu8KKsU3 Y8dZ9ceztJKIIvHC25XJROcyMVa5QA7vmzUYNnQpy8KRGTx6kjj/xsJRSumLwIepdBzv u1sNAQhCuKKWWuFw4fJQeQdZfgm1t2Xs0VXRlhLxqd1Tz9SHXh/UOZ1nT4bWgC5E1Go9 nAwNQJszV2MDdGzzge4lR1EzZlA01Huk9aKL9bJsFnDd82LCwE24ukPXK/b+hWqSyTIh kbtg== 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=5b1CNy+EalSLkZpah7ILkhCVfonaC0myDuqHrIbk5+g=; b=XNlZB/JOo0xEgjUTUHzQYZXH7Y19gwVDGrsS5Hv5t1FTdTGZxaa6jWN8vivIYxd+sB drYp/zThuY/jh8QzUdhvOUBvI+p/UI+ShJLwjQ0bBj2xxm96fryQowPPrePf99KMW2VZ WrVB5UmvhfMw8K/w7E2P3vhe8C9pShVZSVBG19QcV1KtrfnDi2IE/xNXM99DaEVSWShg cPkzBTIUB7fFc67gz/mKOHyK1fClRMurqgSoKk+5Dy7Zi8sR4BCX64azliIRPkq+RLCY YqjZ5CpacHv+Q7eCO0YDsZRDhSqUpDnSd6G+tW0dnPnmxzCBEtNtv77YgUSDPe2/KsN5 drYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=J/7/oemz; spf=pass (google.com: domain of gcc-patches-return-469868-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-469868-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 w62si14355763pgb.129.2017.12.28.12.40.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Dec 2017 12:40:49 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-469868-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=J/7/oemz; spf=pass (google.com: domain of gcc-patches-return-469868-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-469868-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=HQdNiHbSPAjzu4DTLMez9wzf+6HrTqcFs4PY1gqBAcdLVIDx/Vcjd +P2Nb/eHPvXVfB4NNC/OPLYKtmCkZ3ZDvqQSCpfGGFEhuKU9PaW6/Ealo25TVDRY UP6wwtVbphLkR+za4uplD1WmreyhxouD0KBf94UhLcCQOsW91lWp+E= 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=PA+G6jYrGUc0Z7lQeEq4mhfqd8w=; b=J/7/oemzjb2FGXs97gMx 7rJxT0ZuXtIxqVoaiXCw9CB64e5Sb+rXLhTESOOhQ6Pk/yB6hhML/0QHoEvIieMy 7Y4g3zh4NwXrsCbzy6gQrlLK5uGuYawbVeIAcc0NCP5gGnWwU4qRbKG2Vz3JPAo0 /dR67vXTVs0DCOhyXVtWy/E= Received: (qmail 78935 invoked by alias); 28 Dec 2017 20:40:38 -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 78446 invoked by uid 89); 28 Dec 2017 20:40:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f43.google.com Received: from mail-wm0-f43.google.com (HELO mail-wm0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 28 Dec 2017 20:40:36 +0000 Received: by mail-wm0-f43.google.com with SMTP id a79so6512792wma.0 for ; Thu, 28 Dec 2017 12:40:35 -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=5b1CNy+EalSLkZpah7ILkhCVfonaC0myDuqHrIbk5+g=; b=sqDDqNPVXas14BsEYxUIaOjfpqsfCHRgGcrki/+Bt3Wh6NEByPUZ0ml7fVABRnuPwf P6COIngNOo7gKRXwnZfQoRVpAgGINDSJGDE+iiFjYMM235D298n5tWHtegQnyOI0b+fJ ptYGSnfLwaHdglsKfFZ/rQToG1jAwgjfhwr4CUn5FqcfEE+9059y/YF6sdJ0ftEZ2F11 OMWa2KWNdoWKdt0i+63bjDrOIz92dMpG4Qe5Kzf2xtwvVrtAShh50B1ReVXsYJusTtrN ZYYSKGxkky4TCtXPgeqg2dMMXcAqJXsy8KOYLb2DN6/kziUBQ3ayiFpIhBA0hvQZo6eR aj7A== X-Gm-Message-State: AKGB3mIEIx7tmxzJv5qmjR0MfP30bmsBb72A/l033b6Z5+XO054umhUq fZmXQU2XImm/hfA9pkGH9OwTkfDhFgQ= X-Received: by 10.28.61.87 with SMTP id k84mr25691498wma.48.1514493633964; Thu, 28 Dec 2017 12:40:33 -0800 (PST) Received: from localhost ([95.145.138.186]) by smtp.gmail.com with ESMTPSA id q32sm26213901wrb.95.2017.12.28.12.40.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Dec 2017 12:40:33 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [committed] Use valid_for_const_vector_p instead of CONSTANT_P Date: Thu, 28 Dec 2017 20:40:32 +0000 Message-ID: <87d12yio1r.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 This patch makes the VEC_SERIES code use valid_for_const_vector_p instead of CONSTANT_P, to match what we already do for VEC_DUPLICATE. This showed up as a failure in gcc.c-torture/execute/pr28982b.c for -m32 on x86_64-linux-gnu after later patches. Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64-linux-gnu, and with a before-and-after comparison of testsuite output for a range of targets. Applied as obvious. Richard 2017-12-28 Richard Sandiford gcc/ * emit-rtl.c (gen_const_vec_series): Use valid_for_const_vector_p instead of CONSTANT_P. (gen_vec_series): Likewise. * simplify-rtx.c (simplify_binary_operation_1): Likewise. Index: gcc/emit-rtl.c =================================================================== --- gcc/emit-rtl.c 2017-12-23 09:29:19.465366872 +0000 +++ gcc/emit-rtl.c 2017-12-28 16:55:49.382742760 +0000 @@ -5949,7 +5949,8 @@ const_vec_series_p_1 (const_rtx x, rtx * rtx gen_const_vec_series (machine_mode mode, rtx base, rtx step) { - gcc_assert (CONSTANT_P (base) && CONSTANT_P (step)); + gcc_assert (valid_for_const_vector_p (mode, base) + && valid_for_const_vector_p (mode, step)); int nunits = GET_MODE_NUNITS (mode); rtvec v = rtvec_alloc (nunits); @@ -5970,7 +5971,8 @@ gen_vec_series (machine_mode mode, rtx b { if (step == const0_rtx) return gen_vec_duplicate (mode, base); - if (CONSTANT_P (base) && CONSTANT_P (step)) + if (valid_for_const_vector_p (mode, base) + && valid_for_const_vector_p (mode, step)) return gen_const_vec_series (mode, base, step); return gen_rtx_VEC_SERIES (mode, base, step); } Index: gcc/simplify-rtx.c =================================================================== --- gcc/simplify-rtx.c 2017-12-23 09:29:19.493365821 +0000 +++ gcc/simplify-rtx.c 2017-12-28 16:55:49.383742722 +0000 @@ -3590,7 +3590,8 @@ simplify_binary_operation_1 (enum rtx_co case VEC_SERIES: if (op1 == CONST0_RTX (GET_MODE_INNER (mode))) return gen_vec_duplicate (mode, op0); - if (CONSTANT_P (op0) && CONSTANT_P (op1)) + if (valid_for_const_vector_p (mode, op0) + && valid_for_const_vector_p (mode, op1)) return gen_const_vec_series (mode, op0, op1); return 0;