From patchwork Mon Nov 27 14:40:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cupertino Miranda X-Patchwork-Id: 170208 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3171396vqx; Mon, 27 Nov 2023 06:40:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHgpd76nQjqTvmyeeVp6SJqXwX6JxxN+5bFrPrOytn+8XWuP84pqyZxIYWixIzgsgY1boD8 X-Received: by 2002:a05:622a:492:b0:423:93aa:9765 with SMTP id p18-20020a05622a049200b0042393aa9765mr14371611qtx.67.1701096051012; Mon, 27 Nov 2023 06:40:51 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1701096051; cv=pass; d=google.com; s=arc-20160816; b=XgQoFayw87ZfNK90W6SmiITCDNy8iAcaUwOR+dnxTCtxAmLGqzyFwDpjIy4VWo5M7z evDBegw474eWi8AG/J0ehelZLT4E3mOpubQOkHN2bAds7DmY0wDCd1Cg6u7tscB9juuY yfWu0vED1Q/L93lyyhI9Gi2fTtEyf4ux6doXeTNx7lMyKoq9R71nRW6h2LSbsbHgoB5p 0/X9iQreRL+0KiYD1jqSXbeHGQ96rEUQaeTcQfXEc5ondFjMxWY3qGFR86fiE4rhWrJR S471NvTqEp1TXB+vSBTBItZvhQM148gkHfJiJuzdHhjIp8pCaUJlKWChEKshWXeMyfzg afEw== ARC-Message-Signature: i=3; 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:mime-version:message-id:date :subject:cc:to:from:dkim-signature:dkim-signature:arc-filter :dmarc-filter:delivered-to; bh=StobyjdwAIdOypMtVgu6T41qRg4O7z+HM3J4H/pCu28=; fh=N9j9L9iTzsTKqIAjrzeFAbrsiLSPLl0UR6puI5wAePY=; b=bP7zo2+ynl3vfiNYudnSqTZKQejS1KKmk10TUIFZ0H37EHXKWAirscsmwJddykj4Ah caL2jUAGAdfhAf3RN78U7f6ROvoIw7hH6oCVEViUxzZPGxw/55P6LZ5sfN1iO9lqndXF s17H0wltAYtHGuPmmcUz1nigoo0zoUxsUpxdlO4tFTJk7IqEkDSuybmmHg0Nl3JXsKIW cREV+m/GXREygEbJTvfeuqSpfRzlIAXp0Rl4nvJDm+GqmCIhAwvi33ozkMTSFcPcdkdP +G3W6h+G+AMRwE+Gf0Vupz9b51qEkD8NlZ2IueBA2kt5q42qUvDNyCxKcw/zFHMADo9w nltA== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=M3+hT9Ey; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=aS6rM3in; arc=pass (i=2); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id fa10-20020a05622a4cca00b0042399f396f1si7398372qtb.95.2023.11.27.06.40.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 06:40:50 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=M3+hT9Ey; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=aS6rM3in; arc=pass (i=2); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A12583858439 for ; Mon, 27 Nov 2023 14:40:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id B090B3857B85 for ; Mon, 27 Nov 2023 14:40:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B090B3857B85 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B090B3857B85 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1701096026; cv=pass; b=cJux5EpEVlgEh7OuSWUP+F/Z3VwmTW/fLcRWfTHi8O5KcNEtmc2hFeWcfLrV7SpvF3MSzNJGOucIYZVtHU4snCIuN9OKV0NO1vt9r0B6W3Zs/azVpYfGQjGdcFWSXyF7FJekUxTbbsUHoItedeSvSs9AZ8s0axSeHkCijheVZHU= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1701096026; c=relaxed/simple; bh=A6Qq6IZj0mTGPnQgY67pdbv44B8PQIKcXQpm36rBQWs=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=lyDPdreG6g0PLeTE1Tj8PoP2mfSU9xA8YuYztSNLWRpqDd9qgtJGm3sDaQpzntZG1ugnaFtZNiuI4nIgkttsOxGA1K0fCpV7ZTaJcjTajOtsfx6tviYnV5jZ76Qlh8ml6egeLtSdEksS74P+TStWb1NRORwCM2xYajmBXdNvt04= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3ARE43Sq004166 for ; Mon, 27 Nov 2023 14:40:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-type : mime-version; s=corp-2023-11-20; bh=StobyjdwAIdOypMtVgu6T41qRg4O7z+HM3J4H/pCu28=; b=M3+hT9Eyyior/o7VATnuKrdm7OLkcTFceJcvG4BixFmeimIF4Ubd5Nj+hx6TL2OigX6L zXW4pFFk+iVA9oWXESorxMvsY1hFMtTRFmSnyebM1tq88ymtpf3Vi8gRiZ+nAKiZvgJD D9Aw9CLhhRqpqIlrnJ3acM91kqQihefDjYVwAK2liY+FwHdfmYH5R/BnCJyFRmP/dar/ ssNTe7bIEcYkfvNxxraXhIX77RrIchw+PGZOOmnJceon8lUK0ZSGvCZNRRDmo+5Zas5Y OTR8AQyDsKULPazhCX3i1z3qigIQ+UEV8md4lRfFwuXL/QkQvbdSIgdljDITt2Serg3I ZA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3uk8hu33x9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 27 Nov 2023 14:40:23 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3AREa035009277 for ; Mon, 27 Nov 2023 14:40:22 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2040.outbound.protection.outlook.com [104.47.73.40]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3uk7c54m22-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 27 Nov 2023 14:40:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q9G2XWrcrQ7uzhCJ3DgftqmkMygP3+OYTFTVlYZVwJqgR8ibIyuJHPgvgW8oaQvCYxEiX/uPgKHoeEsfkOLxYtSOGF+TZW39Kbc57fp4pt+gWZdPVqjq2+mzYpEigwG60WPOxlsUBXNsAJUA0R8hp/P3WlCyE3MrLanNC42zWdl412Or8NtYPY+xXFs0LcbhapFsdnls5pMRVwuVEC9zvCJEXOrHETVZbMotzODblMM5E90EPDMZtLkjzxdBuD0AIf5G6P02+GL9TKPD3bGgwS5MfwxxFE0YmKIvQ29lopzPt0b/w7n+r9iwZV5tRvN4OQlMVKPLys2hWx+fs3wOEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=StobyjdwAIdOypMtVgu6T41qRg4O7z+HM3J4H/pCu28=; b=JcbXIwtKSMFYsYCBKeovNDAgOU+FVvTtCCI4VkvP1zJ7VL8OtauOutUYXByWp6XjfRGiH4DcrLpx1EkoaTuvWj5p1BVgJ78JxCDfImlI2ok0MGtMwyXW2S3pqd/JN6GQGoIMh1D/cAfGOkb1chf9lKcc4541ES3g8MWpimTELZgbA9gFSCkh57Aj5yW0pblq7OGm7MXM8yR7LSixjt1GHkZQq9yr06n2Bd5cMVohfCQmDPgdEWB12f40z8z+X0ChKgB0yVRoMpNLTs9KbCAiN9X/FE40i2yLrLkyTqdC9kA2ETh5Mpc0li0271Yqic4XaHC9Oav8UN6liTiYH0wIxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=StobyjdwAIdOypMtVgu6T41qRg4O7z+HM3J4H/pCu28=; b=aS6rM3in76vHcKt/dwBIctYMue1bjE7248/vggAhwoD0joFnhk1h3skxl7s9EcbK6zqIQ7VCQfGk0HZo06Bm0YljpHMWMTk/xl46pxe72l376ybJNSzeoS1kGP/9tDdFQDbnsXVDC7w5utmwDq/XpP1fkgM9yOWng5B0bvsaUxo= Received: from BN6PR1001MB2340.namprd10.prod.outlook.com (2603:10b6:405:30::36) by SN7PR10MB6287.namprd10.prod.outlook.com (2603:10b6:806:26d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Mon, 27 Nov 2023 14:40:20 +0000 Received: from BN6PR1001MB2340.namprd10.prod.outlook.com ([fe80::fec4:3a58:6118:aab2]) by BN6PR1001MB2340.namprd10.prod.outlook.com ([fe80::fec4:3a58:6118:aab2%6]) with mapi id 15.20.7025.022; Mon, 27 Nov 2023 14:40:19 +0000 From: Cupertino Miranda To: gcc-patches@gcc.gnu.org Cc: "Jose E. Marchesi" , david.faust@oracle.com Subject: bpf: Throw error when external libcalls are generated. Date: Mon, 27 Nov 2023 14:40:15 +0000 Message-ID: <87msuzb6pc.fsf@oracle.com> X-ClientProxiedBy: LO4P123CA0125.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:192::22) To BN6PR1001MB2340.namprd10.prod.outlook.com (2603:10b6:405:30::36) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN6PR1001MB2340:EE_|SN7PR10MB6287:EE_ X-MS-Office365-Filtering-Correlation-Id: 3098c1ca-6db1-4581-54a9-08dbef56c771 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oo2B67+BEBQZI1qIJQXkIA00QcmMwivNXf1txfZ2o2l7DP64SKzBBN+qcms5kAv7UNFfGemRplEVfLyJ96k2obqC/PzJj7NTv85PJCWSDdC3ne4cXmbaOkafzSCeMU62fPJRUinSfVZOAKpLfpXSFiCodLRxwdJ9YYUN2jO2nkwdCW8qr1b+H3xVntinCocDMcsrLA4AhYC9RTvwQfyXTbeDVhGCgW/tdAcqVadpMOUHiqdStV5jalfz0tq+gRXw8vys3dLENoKdzvJYS0GVQRfETj/HVlL9XH4oxRUkkJ+28tyDQLtO031+8OJls3wEThRALpaaWTX/RXYCZBxIlqOVFPQhePUnms5EzZ0qveBUO1ZE+50jrYhLvVNgHOFc7EDd7FbK/HahMMNmDgFrjXZfsO7Gf7UUE8djuOCX+HAhZ70Jek+7ZddHQeIvX3YBnwezpGcRlXF+wroueDaxjf6986UeUmauSEWm6Bcnl7TUekQ2DaIf8neL6KdFGVTf05LKfiGRy3WvJIPwCEFoP1TX1Gp7hOEKr9lWD/tfNHPg5y77cHyt7xcDzIzeClyVKdBSISaAXaPYlnT3Wk08QB2/aMSnZL9j8QBaoRKYod6c6GuPOWzxVCFiIinqt22A X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR1001MB2340.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(346002)(376002)(396003)(136003)(366004)(230173577357003)(230273577357003)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(38100700002)(41300700001)(36756003)(86362001)(83380400001)(5660300002)(44832011)(107886003)(2616005)(2906002)(6512007)(6506007)(6666004)(8676002)(4326008)(8936002)(478600001)(6486002)(66946007)(66476007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dqDuXTyQ3LNmIwgQzTklciWRj9LfG0I8uYFuknLozGO6KCOtVNRZ6jRSKvQBXEmpPkTWZspfIDX9BscRynDZ/Ghfx664hXNY9gTTYNtL8SdIzkMJte9LQv+3eEpnznXExvSNttycHnrcKGfzHSmDQEnjDP1WdxKXlX3AE/60MCJldvcbKl6yYvqIL8p6W5VXN28KKBQWT7vpAhDhDSbPMyulUo0/owdr5TUhAe6fy8f/KcOOhce1lduFN19oCXVRUZHPKOkPp9yPsPcAEkwpSdIPsNpqpzd5o/tfDxQWrumNfC5WyDHu5a4cwTH7vVoEBwyfnYj4kDupNvaSnwH2xmuhAYloHzZmKjuNHa/H+Gk8TkkZFGA6WKRHPLlmiq7lgJd9+DAaSpudXBzGEPByraqV1l2Nt13xN X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3098c1ca-6db1-4581-54a9-08dbef56c771 X-MS-Exchange-CrossTenant-AuthSource: BN6PR1001MB2340.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2023 14:40:19.9387 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BRRAV4n8bRljyrudcrrpHIvrcCC4ffy5GQkAruk5XbkPPvp+MP3s2/GCKDye7iinhqQQ/VLrKQkpgX7EZhW3eZuVzmYdRi1I3uvaCCYMNbk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR10MB6287 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-27_12,2023-11-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 adultscore=0 suspectscore=0 phishscore=0 bulkscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311270100 X-Proofpoint-GUID: n0Jm7KP_f8XEECCGMKGTjbWxzJ7iOx-a X-Proofpoint-ORIG-GUID: n0Jm7KP_f8XEECCGMKGTjbWxzJ7iOx-a X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: 1783728492603008798 X-GMAIL-MSGID: 1783728492603008798 User-agent: mu4e 1.4.15; emacs 28.1 Author: Cupertino Miranda Hi everyone, The attached patch is a temporary solution for the lack of proper linker and external library linking of the eBPF platform. Any calls created by the compiler, that would usually be defined within libgcc, will endup being undefined in bpftool, when GCC the compiled code is passed. This patch anticipates that error to the compiler, by verifiying if any of those calls are being generated, and reporting as an error. Looking forward to your comments. Cheers, Cupertino commit c2110ae497c7ff83c309f172bc265973652b760d This patch enables errors when external calls are created. When architectural limitations or usage of builtins implies the compiler to create function calls to external libraries that implement the functionality, GCC will now report an error claiming that this function calls are not compatible with eBPF target. Examples of those are the usage of __builtin_memmove and a sign division in BPF ISA v3 or below that will require to call __divdi3. This is currently an eBPF limitation which does not support linking of object files but rather "raw" non linked ones. Those object files are loaded and relocated by libbpf and the kernel. gcc/ChangeLog: * config/bpf/bpf.cc (bpf_output_call): Report error in case the function call is for a builtin. (bpf_external_libcall): Added target hook to detect and report error when other external calls that are not builtins. Date: Mon, 27 Nov 2023 14:40:15 +0000 Message-ID: <87o7ffb6pc.fsf@oracle.com> diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc index 0c9d5257c384..1c84113055b1 100644 --- a/gcc/config/bpf/bpf.cc +++ b/gcc/config/bpf/bpf.cc @@ -744,6 +744,15 @@ bpf_output_call (rtx target) xops[0] = GEN_INT (TREE_INT_CST_LOW (TREE_VALUE (attr_args))); output_asm_insn ("call\t%0", xops); } + else if (fndecl_built_in_p (decl)) + { + /* For now lets report this as an error while we are not able to + link eBPF object files. In particular with libgcc. */ + tree name = DECL_NAME (decl); + error ("call to external builtin %s in function, which is not supported by " + "eBPF", name != NULL_TREE ? IDENTIFIER_POINTER (name) : "(anon)"); + output_asm_insn ("call 0", NULL); + } else output_asm_insn ("call\t%0", &target); @@ -763,6 +772,18 @@ bpf_output_call (rtx target) return ""; } +static void +bpf_external_libcall (rtx fun) +{ + tree decl = SYMBOL_REF_DECL (fun); + tree name = DECL_NAME (decl); + error ("call to external libcall %s in function, which is not supported by " + "eBPF", name != NULL_TREE ? IDENTIFIER_POINTER (name) : "(anon)"); +} + +#undef TARGET_ASM_EXTERNAL_LIBCALL +#define TARGET_ASM_EXTERNAL_LIBCALL bpf_external_libcall + /* Print register name according to assembly dialect. In normal syntax registers are printed like %rN where N is the register number. diff --git a/gcc/testsuite/gcc.target/bpf/atomic-cmpxchg-2.c b/gcc/testsuite/gcc.target/bpf/atomic-cmpxchg-2.c index 4036570ac601..fec720584e48 100644 --- a/gcc/testsuite/gcc.target/bpf/atomic-cmpxchg-2.c +++ b/gcc/testsuite/gcc.target/bpf/atomic-cmpxchg-2.c @@ -6,7 +6,7 @@ foo (int *p, int *expected, int desired) { return __atomic_compare_exchange (p, expected, &desired, 0, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED); -} +} /* { dg-error "call to external builtin" } */ int foo64 (long *p, long *expected, long desired) diff --git a/gcc/testsuite/gcc.target/bpf/atomic-fetch-op-3.c b/gcc/testsuite/gcc.target/bpf/atomic-fetch-op-3.c index 044a2f76474b..ea1b8e48928a 100644 --- a/gcc/testsuite/gcc.target/bpf/atomic-fetch-op-3.c +++ b/gcc/testsuite/gcc.target/bpf/atomic-fetch-op-3.c @@ -9,7 +9,7 @@ long test_atomic_fetch_add (long x) { return __atomic_fetch_add (&val, x, __ATOMIC_ACQUIRE); -} +} /* { dg-error "call to external builtin" } */ long test_atomic_fetch_sub (long x) diff --git a/gcc/testsuite/gcc.target/bpf/atomic-op-3.c b/gcc/testsuite/gcc.target/bpf/atomic-op-3.c index b2ce28926347..fefafd6b748f 100644 --- a/gcc/testsuite/gcc.target/bpf/atomic-op-3.c +++ b/gcc/testsuite/gcc.target/bpf/atomic-op-3.c @@ -20,7 +20,7 @@ void test_atomic_and (int x) { __atomic_and_fetch (&val, x, __ATOMIC_ACQUIRE); -} +} /* { dg-error "call to external builtin" } */ void test_atomic_nand (int x) diff --git a/gcc/testsuite/gcc.target/bpf/atomic-xchg-2.c b/gcc/testsuite/gcc.target/bpf/atomic-xchg-2.c index 3b6324e966b8..eab695bf388c 100644 --- a/gcc/testsuite/gcc.target/bpf/atomic-xchg-2.c +++ b/gcc/testsuite/gcc.target/bpf/atomic-xchg-2.c @@ -7,7 +7,7 @@ int foo (int *p, int *new) int old; __atomic_exchange (p, new, &old, __ATOMIC_RELAXED); return old; -} +} /* { dg-error "call to external builtin" } */ int foo64 (long *p, long *new) { diff --git a/gcc/testsuite/gcc.target/bpf/diag-sdiv.c b/gcc/testsuite/gcc.target/bpf/diag-sdiv.c index c48bbf03df97..c3332558e7d2 100644 --- a/gcc/testsuite/gcc.target/bpf/diag-sdiv.c +++ b/gcc/testsuite/gcc.target/bpf/diag-sdiv.c @@ -7,6 +7,6 @@ foo () { signed int x = 5; signed int y = 2; - signed int z = x / y; + signed int z = x / y; /* { dg-error "call to external libcall" } */ } /* { dg-final { scan-assembler-not "sdiv(32)?\t%r" } } */ diff --git a/gcc/testsuite/gcc.target/bpf/diag-smod.c b/gcc/testsuite/gcc.target/bpf/diag-smod.c index d3df308217f3..25bcb1e4ffdb 100644 --- a/gcc/testsuite/gcc.target/bpf/diag-smod.c +++ b/gcc/testsuite/gcc.target/bpf/diag-smod.c @@ -7,6 +7,6 @@ foo () { signed int x = 5; signed int y = 2; - signed int z = x % y; + signed int z = x % y; /* { dg-error "call to external libcall" } */ } /* { dg-final { scan-assembler-not "smod(32)?\t%r" } } */