From patchwork Tue Apr 24 12:19:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 903392 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-476749-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="Z4J6QWVf"; 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 40Vj881qvsz9ry1 for ; Tue, 24 Apr 2018 22:20:06 +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=CmFI0hvh3MnnQUO wagsxr/FYAg9qYlsmDGHZOlvK4pj48Ut1QMq2LTw2C4MflK38l0P5iSihi78s+ss 6vY7KXv1WsSpYd65qVCpfq66HLLTGCSnEp9dmP5gHKa8bQF3A7jyI0Met8YjKii9 ag8HyYsDtwaYBNWK4rc7vWAWhkIw= 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=FqnZ2Hm/N9ztomMXopG1q vGN8Vg=; b=Z4J6QWVfLqtdiO4HMNAH5ZHrdATNN26s36H6515uqtIBxQ4cjtaBT zLcEygTHqBvDePtgqAm7Hmoi0rA1cuan++kr/H+lUCP//ZAwM5S/jYs3sMJ33ZKE Q+G6WOBsEmGvU2fvBIOW/UaBqN97xmZ9wsg40SVkCV1eEF6XFZxdi4= Received: (qmail 103988 invoked by alias); 24 Apr 2018 12:19:59 -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 103973 invoked by uid 89); 24 Apr 2018 12:19:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=gm 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; Tue, 24 Apr 2018 12:19:56 +0000 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3OCAuSU007858 for ; Tue, 24 Apr 2018 08:19:55 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hj2v1d122-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 24 Apr 2018 08:19:54 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Apr 2018 13:19:53 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 24 Apr 2018 13:19:51 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3OCJoQq57278520 for ; Tue, 24 Apr 2018 12:19:50 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E5D5CAE045 for ; Tue, 24 Apr 2018 13:09:33 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C4A55AE051 for ; Tue, 24 Apr 2018 13:09:33 +0100 (BST) Received: from maggie.boeblingen.de.ibm.com (unknown [9.152.212.134]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS for ; Tue, 24 Apr 2018 13:09:33 +0100 (BST) From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [Committed] Fix PR85478 Date: Tue, 24 Apr 2018 14:19:50 +0200 X-TM-AS-GCONF: 00 x-cbid: 18042412-0040-0000-0000-00000450E340 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18042412-0041-0000-0000-000020F55385 Message-Id: <20180424121950.18057-1-krebbel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-04-24_03:, , 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-1804240118 X-IsSubscribed: yes Bootstrapped and regression tested on x86_64, ppc64, and s390x. Pre-approved by Richard in the PR. -Andreas- gcc/ChangeLog: 2018-04-24 Andreas Krebbel PR tree-optimization/85478 * tree-vect-loop.c (vect_analyze_loop_2): Do not call vect_grouped_store_supported for single element vectors. gcc/testsuite/ChangeLog: 2018-04-24 Andreas Krebbel PR tree-optimization/85478 * g++.dg/pr85478.C: New test. --- gcc/testsuite/g++.dg/pr85478.C | 46 ++++++++++++++++++++++++++++++++++++++++++ gcc/tree-vect-loop.c | 5 +++-- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/pr85478.C diff --git a/gcc/testsuite/g++.dg/pr85478.C b/gcc/testsuite/g++.dg/pr85478.C new file mode 100644 index 0000000..4eb4f24 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr85478.C @@ -0,0 +1,46 @@ +/* { dg-do compile { target { s390*-*-* } } } */ +/* { dg-options "-O3 -march=arch12 -std=c++11 -Wno-return-type" } */ + +struct a { + enum { b }; +}; +struct c { + template static void f(d g, e h) { + d i; + for (; i != g; ++h, ++i) + *h = *i; + } +}; +template void j(d g, e h) { c::f(g, h); } +template void l(d g, e h) { j(g, h); } +template void aa(d g, e h) { l(g, h); } +template class ab; +template <> struct ab { + _Complex m() { return n; } + _Complex n; +}; +template <> struct ab { + ab(ab g) : n(g.m()) {} + _Complex long double n; +}; +template class p { +public: + template p &operator=(const p &); + o *ad; +}; +template class r : public p<2, o> {}; +template +template +p &p::operator=(const p &g) { + aa(&g.ad[0], &ad[0]); +} +template class s : public r { + template s &operator=(const s &); +}; +template +template +s &s::operator=(const s &g) { + p<2, ae>::operator=(g); +} +template s> &s>:: +operator=(const s> &); diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 7b3009a..4ce721ed 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -2492,8 +2492,9 @@ again: unsigned int size = STMT_VINFO_GROUP_SIZE (vinfo); tree vectype = STMT_VINFO_VECTYPE (vinfo); if (! vect_store_lanes_supported (vectype, size, false) - && ! vect_grouped_store_supported (vectype, size)) - return false; + && ! known_eq (TYPE_VECTOR_SUBPARTS (vectype), 1U) + && ! vect_grouped_store_supported (vectype, size)) + return false; FOR_EACH_VEC_ELT (SLP_INSTANCE_LOADS (instance), j, node) { vinfo = vinfo_for_stmt (SLP_TREE_SCALAR_STMTS (node)[0]);