From patchwork Wed Aug 24 13:32:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jose E. Marchesi" X-Patchwork-Id: 732 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:ecc5:0:0:0:0:0 with SMTP id s5csp1422879wro; Wed, 24 Aug 2022 06:33:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR5bH7tf0IWDFYi8dWIf4hXiauUnrhPoRTNKb3SleIEnZT8kwM0hRVVacMn2B2OQOUwXEz4T X-Received: by 2002:a05:6402:3320:b0:446:84c2:a796 with SMTP id e32-20020a056402332000b0044684c2a796mr7797265eda.346.1661347989361; Wed, 24 Aug 2022 06:33:09 -0700 (PDT) Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h20-20020a056402281400b0043d9ec0eb4fsi4942202ede.16.2022.08.24.06.33.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 06:33:09 -0700 (PDT) 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=@gcc.gnu.org header.s=default header.b=WlPFCLyV; arc=fail (signature failed); 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=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3F0C8385415D for ; Wed, 24 Aug 2022 13:33:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F0C8385415D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661347987; bh=Ue2G7//G6nRJjgQxIyTFCR+9avJFrSnkSZlDfPCq7X8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=WlPFCLyVU/Dxo/c5C6xqjnJkfd2Xp+4iQ9KqKtOmyrIvmi/FODcnxCZ4pTv42HHpD pLHxODqGcBZeXHuLssyMPkS8FoJ32091Sl6VbvLn7jG0KrlPcjIsDP5lAr6W8kpr2m Nyf0Go+YbwCNBB4XfHlaig+Djtm3QrygTZzKpw7E= 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 05DCD385843D for ; Wed, 24 Aug 2022 13:32:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 05DCD385843D Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27OCsEsQ018303 for ; Wed, 24 Aug 2022 13:32:20 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3j4w25kej2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 24 Aug 2022 13:32:20 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27ODUgEa002917 for ; Wed, 24 Aug 2022 13:32:19 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2101.outbound.protection.outlook.com [104.47.55.101]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3j3mmb22cx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 24 Aug 2022 13:32:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J6WIz1q32PlhlVaUyPTuC+tSQY9wpjX7ihbqYYdhrGkL868swXEbxxrsY2s8c3DdRJrCLpJ/dYak4tef86WMpaWW8Wr9yeZhAfox10lmYfkFKCzSAnbEpOot4UnoIsgICY6omUuXJIw2We2YRznnxcqyFylaNSAl5QYqjdjNC4DRzVoanxB+8AeUTrnh+o5omFe5ae49gnm1jiohD8LiXHQ4vqaTfgNDvnNuDBC8tggsyQlojmaN9eIi3L6Z8DFUfqAxvY9BPPI+PVTpeKud9lI2Azts/L4EJ01bqjtFCb2nmmkI2Xz0ZvRoARzHB/SUXn7yUshP5N1VKWgd516R5A== 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=Ue2G7//G6nRJjgQxIyTFCR+9avJFrSnkSZlDfPCq7X8=; b=mEUZzgsDszGdv7bm6Xep5Bm//npr2K4GX+j+aZUWHGSXaeXDQx2YsB8J7C1VN826nyUHyZ5ImSXrnP2+XvoUdLF2imuTder+N6NYpBoLnCUxbQs2isM9STTfHYgMMSpM0DrT6Uv1wXQqYnTMjVQnePvgs3s98Dsg2sCWgCnAnpAivcu/a5EfYr+axFZ42pPO3qlKz4W/wfrV1M6jjoo9oT1cp6gZpmAf4S39E3HC0aKCwWAJ+PuM51vi6dCujXMI2HEGXT9omaNi5iXiomXaaWPvo0aLVwJr9EA5VJkvvz44KTSBU7YsRIFuZtUQhU7WEqwTAzERTvS3wI2FaJuNyQ== 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 Received: from BYAPR10MB2888.namprd10.prod.outlook.com (2603:10b6:a03:88::32) by BN0PR10MB4839.namprd10.prod.outlook.com (2603:10b6:408:126::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Wed, 24 Aug 2022 13:32:16 +0000 Received: from BYAPR10MB2888.namprd10.prod.outlook.com ([fe80::6440:83d5:754:2daf]) by BYAPR10MB2888.namprd10.prod.outlook.com ([fe80::6440:83d5:754:2daf%5]) with mapi id 15.20.5546.023; Wed, 24 Aug 2022 13:32:16 +0000 To: gcc-patches@gcc.gnu.org Subject: [COMMITTED] bpf: facilitate constant propagation of function addresses Date: Wed, 24 Aug 2022 15:32:02 +0200 Message-ID: <87v8qh938t.fsf@oracle.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) X-ClientProxiedBy: FR3P281CA0162.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a2::14) To BYAPR10MB2888.namprd10.prod.outlook.com (2603:10b6:a03:88::32) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1b55a970-b67b-483f-b6c4-08da85d50fa5 X-MS-TrafficTypeDiagnostic: BN0PR10MB4839:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dopxmS2CnbOjTgbb3rhBzd7jIqU9urnLn4p4qUFw153Ib/Mk91NDFX9o+R3tVZ3t+3Xi7a5ZIrzgbyIqi1uaEGHdontoYRFGKdb2+RYOs2TRZgFbE6PbiQGhsfn1N5xUynMe5Phq9CjNky5ALn8Zr2DjUmjm6O3CefhVcY0SgY7/0CWRPyd8jFdKHV1c7ESjcTkgnVYzHTeEWmtbBqdx4PpbLaUr4xbcuzB8smGGNaOLACfzH01hEA3z6ydE8ZniQ/dlVy9X/lWF+Xwpst7gJ7x169P11a2MVjSgSgntUmzM7wdll1+S9UWvArhmekkASmKZBC/Bd5luyOPoP4F16RCBYSmG+MVJqZeQ9wtKUL6g8jxHGs9T8ASMRYXq60o+v/UmnT1zc+XubbTjAW7PcVUUVIXARZX95EWF8RFI1W0l8Vt8sSK4sPTMwn17J1m3RvzaQE1rQgQXBAqv9uCGf1s5pLHLz2Wr3q9U6nvq9uNfUtNiOCczVBOTC0JhvtA/uLztZq0ZDAyUFDkplwa4wytDmV30fUtNyHFARGUP5R+VIfvhHZjh1H3W+qP7dsUycnK/RMDndL1X6vlzV7stF8cwgQ00x5zrSKWxthoOGQK20t4u5KMeMwWSe5+WycKjb2nNze0ltp3HDHDZQxW/I2voy6xzPPihWfjnLuv9VPXZeJYq1xIWbJRhZk7+nIIMuiVXy/u3ADInwLA+KsOor020J0ejuSbWWqOoN8Wz8qM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB2888.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(136003)(376002)(396003)(346002)(366004)(41300700001)(6666004)(6512007)(6506007)(86362001)(36756003)(83380400001)(84970400001)(186003)(2616005)(478600001)(6486002)(66946007)(66556008)(8676002)(66476007)(316002)(6916009)(38100700002)(8936002)(5660300002)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YUmBKLe/DmqIt6X6nKiX396+d5nyZXjSchvXvGhuCrG8nvwe5bE4IgqcOXl3uQOPzMWvCDTlfWKstpER39WJJhOOQT8nLNOWuYhivA1Vcp1vam2WCtieKyLCS48SxzCBYJVtJ4LesCiNqG8uzdztR9Y/rBxPtBNOnt4UEZkh3tqN813chqMzK5miKKq9mhR0O7csdziKAxylV/8qA0dnPjXRZ0WPkfgRs0zVveJUy3sNlAymLHojCHG+KnVAzBbwrpQzd5sudcJLtNZyO5oi2wsQDalpROcaATAzOWV11kV+alwkPWXHxKAdiR45MiaNId0XNJpaZBWeECUmJRFI6tf2TDhluFoFWCy9JaSasvtd6G+zWb9VNhDfI22iKeN/TG1HYJBue0rRDYfvNLjpZKtZZ+F+eg/xAH2V1eaeB4NfGsu+l57FMNo5mciVd95Now5/BoFofDaeKQ9qM08gfy2vixc7O6mZngS4SZXL1UxPhhzy+dW9i5PgqLKOh6jbnVihkS0HazRT1Abjlzc7CniF7jyD4VBZbHSTGXeN6cBOYhpCQc5fHwM/ainoaXGXyBdBpI6qufPGua8RB/5PauP4zUf1ZbNcU44rgNemTo5dtz90qSta20XRTnVONOb6ytJ65w4bCaGaYXL/79mGFAvY2bcw2mbcmKVrBlPTe+Xa8VvrEOf1b3UaBMD16ylFLolJZXoJKqZNg/Bt+0sQHFw9s00dzSSv42t+OF9GhfCyOL528ZeHOqxIY86xRc2O/MZbvB/TeWFgssvQlQcYuHsnijNhoLdefTFVrNU3WISD8lHJczhuWha/YkV8JwGRWoN7LZe73xB63VLW6mVIQW3Ncg+PyGN+9EPeYosuKt6yDMP71b6B4EJIoNMRmv+HwL28KyRJ9HOvyynlKQ9QsGzJ21tRmJJD9e2R7a7syCIlsdBsnnGKjDpwtUPctS2mSi/yheqc1wXxiI5MO25uo5CjoKLlP3+Kt0iBwKYs5odDylp+kCyhbxsO3qnR+0G++JAvXMb3gcqbJkvGpRluw6NsKAeKcJ6xSJolE7Mz5jp7AufIwocQXFw3pw1n51wMLydylvLohI7dyCak4oziNkvO7EyjC/ouhht/NGDHHVP6pii7Y4zyy+yBL3H0woqFtFZJrD/hB7HPzo4ntOXJekhhe58duxTk5HJ79tYhQbeURTFugavvUrCFzhYXo1vE8tCBGv0HJmHfUVRy0c7/yRWuDlFKFLrRjFS5WN/qE0Iyw2+hxhrr+NQm4Gw0nwfGcSV0MK+FqCjc3RRwsuTOjshwEmxZnj4u5j76yGjPLHdIzreAy6lzpTn3DzSi70+wrP5DQXFOTF1mMwhe9wSF/PIfFZ0PeF3p18gAxkjAiNSOqgYYKmpzDCSYOGGUXOiFj9UEbMtyDsIkTJ7J0Has69nf838eVj2lhK5c8WJR33LsAp9OJJud2J3wHuAxvwQyQ3AlNsLBJfgcgQxqErzEYXPMS0NfRi02gSze4l24/z2ZWUwAkqbecfT7akpIcPO1xdy3cYhtnUYIF7QS/tgrozjMjx2Rn9K0eLgjmGgYDhOz+0qQiLICrPyQDQtf8qNv5vZvjCvdPkoukE+5xm3MUomACf00YRdYlVnEHYo4EZU6p0hEWvq3tDlMHwNeP+bdo/e1EKabsmo2TFlZpA0R9Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b55a970-b67b-483f-b6c4-08da85d50fa5 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2888.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2022 13:32:16.6517 (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: vyePk1+F4fUjwP69TtsM78yCi5ew2SzKrmDlVLmYZMJRo7UzvtRdjGkAWUG3qPmEawPz/LdWGbhzJAypzCayuSKVToL8RCr2KM+YIgAOzuc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB4839 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-24_07,2022-08-22_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 spamscore=0 phishscore=0 adultscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208240051 X-Proofpoint-ORIG-GUID: zKNOyjFy6mJ6UOcH5c4D4iJWrrVFz0MF X-Proofpoint-GUID: zKNOyjFy6mJ6UOcH5c4D4iJWrrVFz0MF X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Jose E. Marchesi via Gcc-patches" From: "Jose E. Marchesi" Reply-To: "Jose E. Marchesi" Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1742049629269781689?= X-GMAIL-MSGID: =?utf-8?q?1742049629269781689?= eBPF effectively supports two kind of call instructions: - The so called pseudo-calls ("bpf to bpf"). - External calls ("bpf to kernel"). The BPF call instruction always gets an immediate argument, whose interpretation varies depending on the purpose of the instruction: - For pseudo-calls, the immediate argument is interpreted as a 32-bit PC-relative displacement measured in number of 64-bit words minus one. - For external calls, the immediate argument is interpreted as the identification of a kernel helper. In order to differenciate both flavors of CALL instructions the SRC field of the instruction (otherwise unused) is abused as an opcode; if the field holds 0 the instruction is an external call, if it holds BPF_PSEUDO_CALL the instruction is a pseudo-call. C-to-BPF toolchains, including the GNU toolchain, use the following practical heuristic at assembly time in order to determine what kind of CALL instruction to generate: call instructions requiring a fixup at assembly time are interpreted as pseudo-calls. This means that in practice a call instruction involving symbols at assembly time (such as `call foo') is assembled into a pseudo-call instruction, whereas something like `call 12' is assembled into an external call instruction. In both cases, the argument of CALL is an immediate: at the time of writing eBPF lacks support for indirect calls, i.e. there is no call-to-register instruction. This is the reason why BPF programs, in practice, rely on certain optimizations to happen in order to generate calls to immediates. This is a typical example involving a kernel helper: static void * (*bpf_map_lookup_elem)(void *map, const void *key) = (void *) 1; int foo (...) { char *ret; ret = bpf_map_lookup_elem (args...); if (ret) return 1; return 0; } Note how the code above relies on the compiler to do constant propagation so the call to bpf_map_lookup_elem can be compiled to a `call 1' instruction. While GCC provides a kernel_helper function declaration attribute that can be used in a robust way to tell GCC to generate an external call despite of optimization level and any other consideration, the Linux kernel bpf_helpers.h file relies on tricks like the above. This patch modifies the BPF backend to avoid SSA sparse constant propagation to be "undone" by the expander loading the function address into a register. A new test is also added. Tested in bpf-unknown-linux-gnu. No regressions. gcc/ChangeLog: PR target/106733 * config/bpf/bpf.cc (bpf_legitimate_address_p): Recognize integer constants as legitimate addresses for functions. (bpf_small_register_classes_for_mode_p): Define target hook. gcc/testsuite/ChangeLog: PR target/106733 * gcc.target/bpf/constant-calls.c: Rename to ... * gcc.target/bpf/constant-calls-1.c: and modify to not expect failure anymore. * gcc.target/bpf/constant-calls-2.c: New test. --- gcc/config/bpf/bpf.cc | 21 ++++++++++++++++++- .../{constant-calls.c => constant-calls-1.c} | 1 - .../gcc.target/bpf/constant-calls-2.c | 16 ++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) rename gcc/testsuite/gcc.target/bpf/{constant-calls.c => constant-calls-1.c} (88%) create mode 100644 gcc/testsuite/gcc.target/bpf/constant-calls-2.c diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc index 6a0e3bbca9e..7e37e080808 100644 --- a/gcc/config/bpf/bpf.cc +++ b/gcc/config/bpf/bpf.cc @@ -659,12 +659,15 @@ bpf_address_base_p (rtx x, bool strict) target machine for a memory operand of mode MODE. */ static bool -bpf_legitimate_address_p (machine_mode mode ATTRIBUTE_UNUSED, +bpf_legitimate_address_p (machine_mode mode, rtx x, bool strict) { switch (GET_CODE (x)) { + case CONST_INT: + return (mode == FUNCTION_MODE); + case REG: return bpf_address_base_p (x, strict); @@ -1311,6 +1314,22 @@ bpf_core_walk (tree *tp, int *walk_subtrees, void *data) return NULL_TREE; } +/* Implement target hook small_register_classes_for_mode_p. */ + +static bool +bpf_small_register_classes_for_mode_p (machine_mode mode) +{ + if (TARGET_XBPF) + return 1; + else + /* Avoid putting function addresses in registers, as calling these + is not supported in eBPF. */ + return (mode != FUNCTION_MODE); +} + +#undef TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P +#define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P \ + bpf_small_register_classes_for_mode_p /* Implement TARGET_RESOLVE_OVERLOADED_BUILTIN (see gccint manual section Target Macros::Misc.). diff --git a/gcc/testsuite/gcc.target/bpf/constant-calls.c b/gcc/testsuite/gcc.target/bpf/constant-calls-1.c similarity index 88% rename from gcc/testsuite/gcc.target/bpf/constant-calls.c rename to gcc/testsuite/gcc.target/bpf/constant-calls-1.c index 84612a92ae9..6effc7dfdd4 100644 --- a/gcc/testsuite/gcc.target/bpf/constant-calls.c +++ b/gcc/testsuite/gcc.target/bpf/constant-calls-1.c @@ -1,5 +1,4 @@ /* { dg-do compile } */ -/* { dg-xfail-if "" { bpf-*-* } } */ typedef void *(*T)(void); f1 () diff --git a/gcc/testsuite/gcc.target/bpf/constant-calls-2.c b/gcc/testsuite/gcc.target/bpf/constant-calls-2.c new file mode 100644 index 00000000000..836ab67a1fd --- /dev/null +++ b/gcc/testsuite/gcc.target/bpf/constant-calls-2.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-std=c89 -O2" } */ + +static void * (*bpf_map_lookup_elem)(void *map, const void *key) = (void *) 666; + +int foo () +{ + char *ret; + + ret = bpf_map_lookup_elem (ret, ret); + if (ret) + return 0; + return 1; +} + +/* { dg-final { scan-assembler "call\t666" } } */