From patchwork Fri Sep 15 10:49:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 112709 Delivered-To: patch@linaro.org Received: by 10.80.163.150 with SMTP id s22csp454113edb; Fri, 15 Sep 2017 03:49:28 -0700 (PDT) X-Received: by 10.99.126.84 with SMTP id o20mr23866091pgn.201.1505472568730; Fri, 15 Sep 2017 03:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505472568; cv=none; d=google.com; s=arc-20160816; b=GKl812tJvitdSOsMWtvfFhz+Nonpve6ajHjLaL+g/DAiFMq7QluahCIaN1H5zG/xz3 KepidRo5Rgfj6HKp4MTejsZiB8OMi/WkfxqG3BSiLT6x2j4TQZHFh5lMTXjIe9qmCFSl VH7vnf4J0MvdIOUe/2A0fWDfP/w9T1Uj7NOQIWAmGWAONVlobm0w0x4EqG0CWpMK8Epu hucj+eLB4CqMUfsu4+ImI1L8zAAmYEbg7DK0LpmyJoOchvMdLs+McILLbIQUG+Qs5LF5 6DsPtV9XSuDXdobxNER3nu7euhd8EEforsHm+kA5Sp14ya1uSoIdwx/wYmaZ1CNCRNlY u+9g== 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=7m/u7DLYFQg8q4nJBk8rfz3PjkgF1juDRWQdZMbPYHQ=; b=rvHPR8k6G8B5LxP0bJ/lSVCG1O339Y6h/NxSBN2ZBK33yFJ0bNFt+V4C9lj9qvV2cB AKugkSPTTyNeKoKNkexZikkXTFdhWB2X82y9L5sl+tq+XBafvN3Vk3aWSuJOAgewUsUb S3qF3N4QzbtxRG44fkIW214qj8eMNo4AXX2oV9HidA90BJ6s+kQmrJLTX4lmW0rCMQmy QpybKTvHYucOmZCZddYW6X8Dzx5w+pmjZt7d2IonN1dkSgb4JGLgpybkdTvWiJKwOhjZ VHvPX9GfBvYzmtnexsr7FB+sb2w7A40XdwkASlFlZ7J2fvAvL77TBLjk7P2ivBiPzG5j kWZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=qW9r3x/O; spf=pass (google.com: domain of gcc-patches-return-462223-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-462223-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 3si496768pll.635.2017.09.15.03.49.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Sep 2017 03:49:28 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-462223-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=qW9r3x/O; spf=pass (google.com: domain of gcc-patches-return-462223-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-462223-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=uqzOepHCZK1O2SXvrpMQ7PhQBBSQ/s6A2mGv3cjnnm3evRn4tS7++ kErg90oGKRM8gDYyI+LSgeR7sPCWBOqGWiMrGpEaCukJqvU6jl0Q57JqiGfFCGpT 7JfeSb4rznNr4ygOEVYKbv2lg9uoTMVnSEuVufYDFBrGmWWaat6CyY= 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=7nlMqTuuIBOIcPM5Fmfl9MYMno8=; b=qW9r3x/O2Px7GTDmWMB0 ZilFZRNiLmJPEUnlkEMvwAMBTRtY64fhvSg+Z0HNYdPFCN0TXlRtd8bfxPpQvKkg VIgj700kDgjLfv8zKkzIhC82agC69O+/V83uRL8n7NmgPEOetw8KR+L6fRGkEdIE VdZextiXKT5ONPp0hNEJBPA= Received: (qmail 88815 invoked by alias); 15 Sep 2017 10:49:18 -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 88806 invoked by uid 89); 15 Sep 2017 10:49:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=proven X-HELO: mail-wm0-f41.google.com Received: from mail-wm0-f41.google.com (HELO mail-wm0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Sep 2017 10:49:16 +0000 Received: by mail-wm0-f41.google.com with SMTP id g206so7266969wme.0 for ; Fri, 15 Sep 2017 03:49: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=7m/u7DLYFQg8q4nJBk8rfz3PjkgF1juDRWQdZMbPYHQ=; b=pCPKfms/1litV5KOJR6ay2iQ6g9TYA3vnD1ZFWW67sbf9cSPIqPVX3ClIKLu3sqvVL UN/8EYUd9ZhjpiyfBKfHYE/DvYr6ujsIqD1/39O70f/S+p43FzaDhp6Ztw2dDNzvcso8 X9b2et94Oxy9Mw+LQKOsWekN9pGG1bWTZhnIppDjOt9fwzbaOZ+nHfQrupESYPso3mhJ 7UXnL1CQY8EFxHv5D0U54i4cu3zlO1SGV1i2cdrLbQET8cRM87LSZ6F25vnOD9Bhr+3o CGDaM65MMnQnzSVrEZLxWdVLFqEPxxHz9lANnaxc8La6GENCgcEnmShy22p22/Cxm5V7 KgHg== X-Gm-Message-State: AHPjjUjoZUmzL/okbI432gMbHXhEnqGIQhzqq0Yjg6x4a952bsOwf7ct rbx9K8ZKrYmw/lL4ZCvjlw== X-Google-Smtp-Source: AOwi7QCOsT9Lvx86EghqxWdO4i8eyWiiY/iHLC/FYjdluFGdRbTPOzrIYpNp47f5uNFPyvNxO7q0Hw== X-Received: by 10.28.13.76 with SMTP id 73mr2237744wmn.101.1505472554465; Fri, 15 Sep 2017 03:49:14 -0700 (PDT) Received: from localhost (92.40.248.1.threembb.co.uk. [92.40.248.1]) by smtp.gmail.com with ESMTPSA id f140sm677319wmd.12.2017.09.15.03.49.13 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Sep 2017 03:49: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 an SVE failure in the Fortran matmul* tests Date: Fri, 15 Sep 2017 11:49:02 +0100 Message-ID: <87wp50me3l.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 The vectoriser was calling vect_get_smallest_scalar_type without having proven that the type actually is a scalar. This seems to be the intended behaviour: the ultimate test of whether the type is interesting (and hence scalar) is whether an associated vector type exists, but this is only tested later. The patch simply makes the function cope gracefully with non-scalar inputs. Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64le-linux-gnu. OK to install? Richard 2017-09-15 Richard Sandiford Alan Hayward David Sherwood gcc/ * tree-vect-data-refs.c (vect_get_smallest_scalar_type): Cope with types that aren't in fact scalar. Index: gcc/tree-vect-data-refs.c =================================================================== --- gcc/tree-vect-data-refs.c 2017-09-14 17:35:26.634355297 +0100 +++ gcc/tree-vect-data-refs.c 2017-09-15 11:41:22.764283196 +0100 @@ -118,6 +118,11 @@ vect_get_smallest_scalar_type (gimple *s tree scalar_type = gimple_expr_type (stmt); HOST_WIDE_INT lhs, rhs; + /* During the analysis phase, this function is called on arbitrary + statements that might not have scalar results. */ + if (!tree_fits_uhwi_p (TYPE_SIZE_UNIT (scalar_type))) + return scalar_type; + lhs = rhs = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (scalar_type)); if (is_gimple_assign (stmt)