From patchwork Mon Apr 16 16:16:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 898759 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-476430-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="CvTekhnh"; 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 40Ptmp5PGpz9ry1 for ; Tue, 17 Apr 2018 02:16:41 +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; q=dns; s=default; b=mKtwJI29NqEdtku nnZ9rKFC0FdGOcpGsp/1+K+pAdaocZT0K/hk8VXbOlpxybiIgUocQvVrEpRSdkfM p2CxpEEFveioQOYtuLLZvkSK88FMLkbowLVBkVI+6aOTqr0ga7LsneDCYQTiiiGx YvfELMuDl3u/Nf9/MX3QFcKGvlPg= 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; s=default; bh=ezjcLcXVOysq6APIOptsI lJPsXE=; b=CvTekhnhDiAvpPrEsPWFIFFXpiyo4dFkiK2niy/I8Fc/6vxXUeUqV w60mDXyw5tWBnaJ7g4uPJwqXX0glcupwHwy4DBWpjDA0OQ97j0TVb4hblJ155Ce1 O+FAu+VmSHG0Yyx/+VYU7kvo4mKfMWFlyIz+TaAER6HtX05abITnzY= Received: (qmail 48353 invoked by alias); 16 Apr 2018 16:16:34 -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 48211 invoked by uid 89); 16 Apr 2018 16:16:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=stepped X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Apr 2018 16:16:24 +0000 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3GGEqo8095663 for ; Mon, 16 Apr 2018 12:16:20 -0400 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0b-001b2d01.pphosted.com with ESMTP id 2hcwken02p-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 16 Apr 2018 12:16:19 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 16 Apr 2018 17:16:18 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 16 Apr 2018 17:16:17 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3GGGHKM9634168 for ; Mon, 16 Apr 2018 16:16:17 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A2FDA11C04A for ; Mon, 16 Apr 2018 17:08:14 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 87A7311C05B for ; Mon, 16 Apr 2018 17:08:14 +0100 (BST) Received: from maggie.boeblingen.de.ibm.com (unknown [9.152.212.134]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS for ; Mon, 16 Apr 2018 17:08:14 +0100 (BST) From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix ICE with single element vector Date: Mon, 16 Apr 2018 18:16:16 +0200 X-TM-AS-GCONF: 00 x-cbid: 18041616-0012-0000-0000-000005CB7893 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18041616-0013-0000-0000-00001947BDC9 Message-Id: <20180416161616.28037-1-krebbel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-04-16_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804160148 X-IsSubscribed: yes I did run into an ICE with a single element vector triggered by dividing the number of elements by 2 with exact_div here: tree-vect-data-refs.c:5132 else { /* If length is not equal to 3 then only power of 2 is supported. */ gcc_assert (pow2p_hwi (count)); poly_uint64 nelt = GET_MODE_NUNITS (mode); /* The encoding has 2 interleaved stepped patterns. */ vec_perm_builder sel (nelt, 2, 3); sel.quick_grow (6); for (i = 0; i < 3; i++) { sel[i * 2] = i; sel[i * 2 + 1] = i + nelt; } vec_perm_indices indices (sel, 2, nelt); if (can_vec_perm_const_p (mode, indices)) { for (i = 0; i < 6; i++) sel[i] += exact_div (nelt, 2); <----- indices.new_vector (sel, 2, nelt); if (can_vec_perm_const_p (mode, indices)) return true; } } The patch adds a check to prevent this. Ok? -Andreas- gcc/ChangeLog: 2018-04-16 Andreas Krebbel * tree-vect-data-refs.c (vect_grouped_store_supported): Exit for single element vectors. --- gcc/tree-vect-data-refs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 161a886..01e28ca 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -5135,6 +5135,9 @@ vect_grouped_store_supported (tree vectype, unsigned HOST_WIDE_INT count) gcc_assert (pow2p_hwi (count)); poly_uint64 nelt = GET_MODE_NUNITS (mode); + if (maybe_eq (nelt, 1U)) + return false; + /* The encoding has 2 interleaved stepped patterns. */ vec_perm_builder sel (nelt, 2, 3); sel.quick_grow (6);