From patchwork Tue Nov 14 10:51:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 164822 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1775263vqg; Tue, 14 Nov 2023 02:51:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDuLnFqbLZl40Qa4iSmIA9ZcDY5amBq7V3jlXw6ayWgDZbK9v0JK09YImAerYLD4O+ZnTk X-Received: by 2002:a25:b08:0:b0:da0:cea9:2b3b with SMTP id 8-20020a250b08000000b00da0cea92b3bmr8703875ybl.62.1699959111238; Tue, 14 Nov 2023 02:51:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699959111; cv=pass; d=google.com; s=arc-20160816; b=X7VvYLYxe830t4vr/gzzZLwg6senGAens04Es19Q/S2UbqX4CSwxIEmxY8PTRtwpHY isWFH4MqXU+riuiHqD/IzFKx2uVHISDUahJsHROVvr6lI0lOHodBHs2DrJFpusLQ8X8d CAZp5XJ+CjOLetOZJTWaU9FY05VltJlFIcfJ1JiWLUSIDSc2bDf69KimEQA/zTusX10M b5IheLQGkHoqkMwZOYH5mQCwactvxIrwGHxnstGFa/EUV1Lgqzb3pavf3XK8XyLnSTNw fiFTHWUTSvWiPvxz0vUeNs9Dc5D74LOkrZVaqSuEYFvVHCFvHuKUEyPrvvLNT89A7VNJ GUDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=qXWum2+7DaRl3OXTZQo9YFiw5FLy2VBs3l0QEESUOhg=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=CWCq6rqKEf0Vw96WvoeRLkJY1u/dyVFnWcXKQtksaqESfZ434KRqH4EWOUTUS9SGrB fLZQ09DW7v3S92Hi099Tuw9gFDZ1poulKcMi7UGYepLfQPK/gbQRKi4A6gkOpTe1Vcq5 Ez+o6WK9MC2H7KTzQ/AO+AUPN/PJ0Q27wxyoGJuCxEwwBUgXIb2zlWhMStTdeMrD4hCP ry7QUeOtSzDHuk5ke3n+FAJ+2xdJcaBDRC++xFd+Vd1Bd1Dy4npSdpoYXgdi9mNkBN41 gQwu3gk8LsB7EDqHeXFPfDunceZKZVKyjLAn56qd5UKe8syyBJZn4hQNTY5Ssy8M3CU8 EWHw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=lHxF1MYq; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q10-20020ad4402a000000b00656545d4e2dsi6254730qvp.530.2023.11.14.02.51.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 02:51:51 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=lHxF1MYq; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9FF80383E71E for ; Tue, 14 Nov 2023 10:51:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 2198A3851AB7 for ; Tue, 14 Nov 2023 10:51:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2198A3851AB7 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2198A3851AB7 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699959086; cv=none; b=DnaPryu1u9sQVVCA/ndGOFjbWv0Sv4g14I5nt4phnkOVr6gTr4vLiTIlMEMgzeW1/F1qsb6jIN5loAYvn+0C2S+lEtDh1hggPZ2iiyTtSSaPQfAx0VwNHpWbBMa9je6CAA1M446m4l5QRMlwe9nj3VSJszaie2ALGbuJXqLLw1g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699959086; c=relaxed/simple; bh=QDg+W71jeRc0c/Nb5NCCRJ8q4HB+bPvv9nX4flHGKQk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=nADv6UgAmxJQBJUgIO8TU3JwCpB4JhhLAkAgZuzkx1zuZA4LfzdxGqEB6b/EUC3en1UgxNvXvLTOZHC+oaW64A1wFlUT0h+aWHyJtcKFkVLun4yHP6IB/BjF33uOtE2f1DgWX8b7xcVApIyB4fuM4oJBAd2I7KTYetKDPz7TJuU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AEAlgd9021498 for ; Tue, 14 Nov 2023 10:51:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=qXWum2+7DaRl3OXTZQo9YFiw5FLy2VBs3l0QEESUOhg=; b=lHxF1MYqaXVMy5YcyqQp5HPPuJm5hvQrwusCy0yEoMBB4XxSK7MnxbJrozQJtTtdcs26 KM5BEl19HGPdtbpHtDtmmS+zHeMnAKzPWAnpXb+IWA0j44Ye/8JhByHRl3Uu3Ric3Ya2 LbcgIkpV1aYMpWoEk8d4zPbQZ4heaDA+huzo28f0vqj4l7WTbF5jeO0NbkCX9DTjbDop beX3JuEgCIZ3D8p1UBZeFamTYCdKdRT2dt3L9gtBd+PQ04k8EtqUehyOXBHTMOXnv6aQ qsJGTd82jz54OxgK4Oaaxl24CBbkkC8SLLZ0FbHROguvmtIFELrg0eWslQdDewWpNLRm zg== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uc7esr2yt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 14 Nov 2023 10:51:23 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3AE8Xw43014683 for ; Tue, 14 Nov 2023 10:51:21 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uamay7drx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 14 Nov 2023 10:51:21 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3AEApJ6144565028 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 14 Nov 2023 10:51:19 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7D58020043 for ; Tue, 14 Nov 2023 10:51:19 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4C95820040 for ; Tue, 14 Nov 2023 10:51:19 +0000 (GMT) Received: from li-ecc9ffcc-3485-11b2-a85c-e633c5126265.fritz.box (unknown [9.171.2.167]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP for ; Tue, 14 Nov 2023 10:51:19 +0000 (GMT) From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [Committed] IBM Z: Fix ICE with overloading and checking enabled Date: Tue, 14 Nov 2023 11:51:18 +0100 Message-ID: <20231114105118.303519-1-krebbel@linux.ibm.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: LGNkFhlDbx3_VBHplliYY6fwQLUWUPbg X-Proofpoint-GUID: LGNkFhlDbx3_VBHplliYY6fwQLUWUPbg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-14_10,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 impostorscore=0 bulkscore=0 adultscore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311140085 X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FUZZY_PRICES, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782536325419245343 X-GMAIL-MSGID: 1782536325419245343 s390_resolve_overloaded_builtin, when called on NON_DEPENDENT_EXPR, ICEs when using the type from it which ends up as error_mark_node. This particular instance of the problem does not occur anymore since NON_DEPENDENT_EXPR has been removed. Nevertheless that case needs to be handled here. Bootstrapped and regression tested on IBM Z. Committed to mainline. gcc/ChangeLog: * config/s390/s390-c.cc (s390_fn_types_compatible): Add a check for error_mark_node. gcc/testsuite/ChangeLog: * g++.target/s390/zvec-templ-1.C: New test. --- gcc/config/s390/s390-c.cc | 3 +++ gcc/testsuite/g++.target/s390/zvec-templ-1.C | 24 ++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 gcc/testsuite/g++.target/s390/zvec-templ-1.C diff --git a/gcc/config/s390/s390-c.cc b/gcc/config/s390/s390-c.cc index 269f4f8e978..fce569342f3 100644 --- a/gcc/config/s390/s390-c.cc +++ b/gcc/config/s390/s390-c.cc @@ -781,6 +781,9 @@ s390_fn_types_compatible (enum s390_builtin_ov_type_index typeindex, tree in_arg = (*arglist)[i]; tree in_type = TREE_TYPE (in_arg); + if (in_type == error_mark_node) + goto mismatch; + if (VECTOR_TYPE_P (b_arg_type)) { /* Vector types have to match precisely. */ diff --git a/gcc/testsuite/g++.target/s390/zvec-templ-1.C b/gcc/testsuite/g++.target/s390/zvec-templ-1.C new file mode 100644 index 00000000000..07bb65f199b --- /dev/null +++ b/gcc/testsuite/g++.target/s390/zvec-templ-1.C @@ -0,0 +1,24 @@ +// { dg-do compile } +// { dg-options "-O0 -mzvector -march=arch14 -mzarch" } +// { dg-bogus "internal compiler error" "ICE" { target s390*-*-* } 23 } +// { dg-excess-errors "" } + +/* This used to ICE with checking enabled because + s390_resolve_overloaded_builtin gets called on NON_DEPENDENT_EXPR + arguments. We then try to determine the type of it, get an error + node and ICEd consequently when using this. + + This particular instance of the problem disappeared when + NON_DEPENDENT_EXPRs got removed with: + + commit dad311874ac3b3cf4eca1c04f67cae80c953f7b8 + Author: Patrick Palka + Date: Fri Oct 20 10:45:00 2023 -0400 + + c++: remove NON_DEPENDENT_EXPR, part 1 + + Nevertheless we should check for error mark nodes in that code. */ + +template void foo() { + __builtin_s390_vec_perm( , , ); +}