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: 814214 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-462223-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="YjV0jmiT"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xtsbT5Q02z9t2Z for ; Fri, 15 Sep 2017 20:49:25 +1000 (AEST) 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=qway/0uZY5tWWh5Zlvu6vmMOZl9xc+2O6qCgUk8LLmWu8Z2siKAFs IQWTYAjuE2TtTnpD059AwleLzcDrllJOMxJDfg9MVWfBYAP4kJ1KBN4hxl39cXCG qpsbgbFwao+wwYGAS+RntKyPqjJR+eBW5GdZ2k6j30zCLG7pshZ2YQ= 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=YjV0jmiTtDrS0CkOosNB gVv+RWkOBMBZ4ulWAVpbtQcYxDgQTXRyIRbY08H+crk2dHVN+tS8RS6o7sE1wNb+ Rb81x9nt1ynh7YvMBMyU0mBqNx0NKseN70MwGuA6xxM+ZiDbxtXoy6VeW6zTD/0d 4IiRJ6jicxwUe/aMSJ8L/mU= 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)