From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 020963858006 for ; Mon, 22 Nov 2021 02:25:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 020963858006 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AM1faa2004720; Mon, 22 Nov 2021 02:25:36 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cg1ru8jys-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Nov 2021 02:25:35 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1AM1vfhE017661; Mon, 22 Nov 2021 02:25:35 GMT Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cg1ru8jy7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Nov 2021 02:25:35 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1AM2GtKA015925; Mon, 22 Nov 2021 02:25:33 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma04fra.de.ibm.com with ESMTP id 3cernarch3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Nov 2021 02:25:32 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1AM2PUT83211810 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Nov 2021 02:25:30 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 790E6AE053; Mon, 22 Nov 2021 02:25:30 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 26CC2AE04D; Mon, 22 Nov 2021 02:25:29 +0000 (GMT) Received: from kewenlins-mbp.cn.ibm.com (unknown [9.200.146.131]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 22 Nov 2021 02:25:28 +0000 (GMT) Subject: PING^3 [PATCH] rs6000: Remove builtin mask check from builtin_decl [PR102347] To: Segher Boessenkool Cc: Bill Schmidt , David Edelsohn , GCC Patches References: <7505a666-7b51-255c-9908-aabc753f7c33@linux.ibm.com> <157a79bf-6de0-d6dd-f972-fd60d764b478@linux.ibm.com> From: "Kewen.Lin" Message-ID: <7d0e415c-a376-95d7-9a0a-e9987a1afb75@linux.ibm.com> Date: Mon, 22 Nov 2021 10:25:27 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 In-Reply-To: Content-Type: text/plain; charset=gbk Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: tSULm40yh-Myx64-L643P_hgXHek4YvD X-Proofpoint-GUID: XDjDP1w7sHw3zV8jBPX9QS9tgIBULMen Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-21_13,2021-11-17_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 mlxscore=0 priorityscore=1501 impostorscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111220010 X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, MIME_CHARSET_FARAWAY, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Nov 2021 02:25:39 -0000 Hi, As the discussions and the testing result under the main thread, this patch would be safe. Ping for this: https://gcc.gnu.org/pipermail/gcc-patches/2021-September/580357.html BR, Kewen >> on 2021/9/28 ÏÂÎç4:13, Kewen.Lin via Gcc-patches wrote: >>> Hi, >>> >>> As the discussion in PR102347, currently builtin_decl is invoked so >>> early, it's when making up the function_decl for builtin functions, >>> at that time the rs6000_builtin_mask could be wrong for those >>> builtins sitting in #pragma/attribute target functions, though it >>> will be updated properly later when LTO processes all nodes. >>> >>> This patch is to align with the practice i386 port adopts, also >>> align with r10-7462 by relaxing builtin mask checking in some places. >>> >>> Bootstrapped and regress-tested on powerpc64le-linux-gnu P9 and >>> powerpc64-linux-gnu P8. >>> >>> Is it ok for trunk? >>> >>> BR, >>> Kewen >>> ----- >>> gcc/ChangeLog: >>> >>> PR target/102347 >>> * config/rs6000/rs6000-call.c (rs6000_builtin_decl): Remove builtin >>> mask check. >>> >>> gcc/testsuite/ChangeLog: >>> >>> PR target/102347 >>> * gcc.target/powerpc/pr102347.c: New test. >>> >>> --- >>> gcc/config/rs6000/rs6000-call.c | 14 ++++---------- >>> gcc/testsuite/gcc.target/powerpc/pr102347.c | 15 +++++++++++++++ >>> 2 files changed, 19 insertions(+), 10 deletions(-) >>> create mode 100644 gcc/testsuite/gcc.target/powerpc/pr102347.c >>> >>> diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c >>> index fd7f24da818..15e0e09c07d 100644 >>> --- a/gcc/config/rs6000/rs6000-call.c >>> +++ b/gcc/config/rs6000/rs6000-call.c >>> @@ -13775,23 +13775,17 @@ rs6000_init_builtins (void) >>> } >>> } >>> >>> -/* Returns the rs6000 builtin decl for CODE. */ >>> +/* Returns the rs6000 builtin decl for CODE. Note that we don't check >>> + the builtin mask here since there could be some #pragma/attribute >>> + target functions and the rs6000_builtin_mask could be wrong when >>> + this checking happens, though it will be updated properly later. */ >>> >>> tree >>> rs6000_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED) >>> { >>> - HOST_WIDE_INT fnmask; >>> - >>> if (code >= RS6000_BUILTIN_COUNT) >>> return error_mark_node; >>> >>> - fnmask = rs6000_builtin_info[code].mask; >>> - if ((fnmask & rs6000_builtin_mask) != fnmask) >>> - { >>> - rs6000_invalid_builtin ((enum rs6000_builtins)code); >>> - return error_mark_node; >>> - } >>> - >>> return rs6000_builtin_decls[code]; >>> } >>> >>> diff --git a/gcc/testsuite/gcc.target/powerpc/pr102347.c b/gcc/testsuite/gcc.target/powerpc/pr102347.c >>> new file mode 100644 >>> index 00000000000..05c439a8dac >>> --- /dev/null >>> +++ b/gcc/testsuite/gcc.target/powerpc/pr102347.c >>> @@ -0,0 +1,15 @@ >>> +/* { dg-do link } */ >>> +/* { dg-require-effective-target power10_ok } */ >>> +/* { dg-require-effective-target lto } */ >>> +/* { dg-options "-flto -mdejagnu-cpu=power9" } */ >>> + >>> +/* Verify there are no error messages in LTO mode. */ >>> + >>> +#pragma GCC target "cpu=power10" >>> +int main () >>> +{ >>> + float *b; >>> + __vector_quad c; >>> + __builtin_mma_disassemble_acc (b, &c); >>> + return 0; >>> +} >>> -- >>> 2.27.0 >>> >>