From patchwork Fri Mar 24 14:04:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 743187 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3vqQD85jstz9s8Q for ; Sat, 25 Mar 2017 01:05:12 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="glRRzY4K"; dkim-atps=neutral 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=YQxtDDlkR3j19Rj yhA74/gMz7CT3j0c9aNm/cKxE+VxgyG/Yk8WH1NSMx3IhGUGGowrLFA8LeDREJ9p +zFgrqqeGgaOXqiBAui0a8xzve9WGVN++Y0leuWYpNi5W4O+Qga8uNlBKj7J9CbM cYDz4gJ8YvJjqcZry9UAMAiWGZV8= 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=BAPk9NAz064Q8uONPpa3v hc/kAI=; b=glRRzY4KqK1llTcICBOwsLxcAovoT8VLv+ejxVI5MoMH8QQM0I0uL 1Us3a2k3JoKwk5ESmF3gU+S05DBqwAbJ3y0MYSeldZejA4WZ4kx4siPWnPc4mVun 0tgduG6kjt8MgQXQrFueebtP+dxWSQvZuVx2si2/QrkAbVzoyw97pw= Received: (qmail 13704 invoked by alias); 24 Mar 2017 14:05:01 -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 13359 invoked by uid 89); 24 Mar 2017 14:05:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.0 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=291, H*MI:20170324140455, H*m:20170324140455 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; Fri, 24 Mar 2017 14:04:59 +0000 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2OE3bXB087083 for ; Fri, 24 Mar 2017 10:04:59 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 29cu2guv2j-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 24 Mar 2017 10:04:59 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Mar 2017 14:04:57 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Mar 2017 14:04:56 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2OE4t7s32768090 for ; Fri, 24 Mar 2017 14:04:55 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 29F904C044 for ; Fri, 24 Mar 2017 14:04:34 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 19B1C4C04E for ; Fri, 24 Mar 2017 14:04:34 +0000 (GMT) Received: from maggie.boeblingen.de.ibm.com (unknown [9.152.212.134]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS for ; Fri, 24 Mar 2017 14:04:34 +0000 (GMT) From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [Committed] S/390: PR79893: Add diagnostics vec_load_bndry builtin. Date: Fri, 24 Mar 2017 15:04:55 +0100 X-TM-AS-GCONF: 00 x-cbid: 17032414-0020-0000-0000-0000032DF14F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17032414-0021-0000-0000-000040F24DBF Message-Id: <20170324140455.15902-1-krebbel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-24_12:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703240122 X-IsSubscribed: yes The boundary argument of the vec_load_bndry builtin needs to be rewritten. At that point it must be constant already. The current diagnostics in s390_expand_builtins is too late for this. The patch adds an additional check for that builtin which will be triggered already during preprocessing. Regression tested on s390x. gcc/testsuite/ChangeLog: 2017-03-24 Andreas Krebbel PR target/79893 * gcc.target/s390/zvector/pr79893.c: New test. gcc/ChangeLog: 2017-03-24 Andreas Krebbel PR target/79893 * config/s390/s390-c.c (s390_adjust_builtin_arglist): Issue an error if the boundary argument is not constant. --- gcc/ChangeLog | 6 ++++++ gcc/config/s390/s390-c.c | 12 ++++++++++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/s390/zvector/pr79893.c | 9 +++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/s390/zvector/pr79893.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8d4adfb..9cb2271 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-03-24 Andreas Krebbel + + PR target/79893 + * config/s390/s390-c.c (s390_adjust_builtin_arglist): Issue an + error if the boundary argument is not constant. + 2017-03-24 Bill Schmidt PR tree-optimization/80158 diff --git a/gcc/config/s390/s390-c.c b/gcc/config/s390/s390-c.c index 8cdac7e..0521e1e 100644 --- a/gcc/config/s390/s390-c.c +++ b/gcc/config/s390/s390-c.c @@ -673,10 +673,18 @@ s390_adjust_builtin_arglist (unsigned int ob_fcode, tree decl, case S390_OVERLOADED_BUILTIN_s390_vec_load_bndry: { int code; - if (dest_arg_index == 1) { - switch (tree_to_uhwi ((**arglist)[src_arg_index])) + tree arg = (**arglist)[src_arg_index]; + + if (TREE_CODE (arg) != INTEGER_CST) + { + error ("constant value required for builtin %qF argument %d", + decl, src_arg_index + 1); + return; + } + + switch (tree_to_uhwi (arg)) { case 64: code = 0; break; case 128: code = 1; break; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 759d2b3..f3908d9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-03-24 Andreas Krebbel + + PR target/79893 + * gcc.target/s390/zvector/pr79893.c: New test. + 2017-03-24 Bill Schmidt PR tree-optimization/80158 diff --git a/gcc/testsuite/gcc.target/s390/zvector/pr79893.c b/gcc/testsuite/gcc.target/s390/zvector/pr79893.c new file mode 100644 index 0000000..ad6ca30 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/zvector/pr79893.c @@ -0,0 +1,9 @@ +/* { dg-do compile { target { s390*-*-* } } } */ +/* { dg-options "-march=z13 -mzarch -mzvector" } */ + +#include + +void +foo(signed char *p, int i) { + vec_load_bndry(p, i); /* { dg-error "constant value required for builtin.*2" } */ +}