Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2228971/?format=api
{ "id": 2228971, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2228971/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260427152604.61630-1-cupertino.miranda@oracle.com/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/1.1/projects/17/?format=api", "name": "GNU Compiler Collection", "link_name": "gcc", "list_id": "gcc-patches.gcc.gnu.org", "list_email": "gcc-patches@gcc.gnu.org", "web_url": null, "scm_url": null, "webscm_url": null }, "msgid": "<20260427152604.61630-1-cupertino.miranda@oracle.com>", "date": "2026-04-27T15:26:04", "name": "bpf: Fix bit-field shifting in CO-RE expressions", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "783a9793a90bdb727e79f03f4f749630dd439ffc", "submitter": { "id": 85366, "url": "http://patchwork.ozlabs.org/api/1.1/people/85366/?format=api", "name": "Cupertino Miranda", "email": "cupertino.miranda@oracle.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260427152604.61630-1-cupertino.miranda@oracle.com/mbox/", "series": [ { "id": 501675, "url": "http://patchwork.ozlabs.org/api/1.1/series/501675/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=501675", "date": "2026-04-27T15:26:04", "name": "bpf: Fix bit-field shifting in CO-RE expressions", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/501675/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2228971/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2228971/checks/", "tags": {}, "headers": { "Return-Path": "<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256\n header.s=corp-2025-04-25 header.b=k33CGBvZ;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com\n header.a=rsa-sha256 header.s=selector2-oracle-onmicrosoft-com\n header.b=S9whFZ6o;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256\n header.s=corp-2025-04-25 header.b=k33CGBvZ;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com\n header.a=rsa-sha256 header.s=selector2-oracle-onmicrosoft-com\n header.b=S9whFZ6o", "sourceware.org;\n dmarc=pass (p=reject dis=none) header.from=oracle.com", "sourceware.org; spf=pass smtp.mailfrom=oracle.com", "server2.sourceware.org;\n arc=pass smtp.remote-ip=205.220.177.32" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g46qr5n2Mz1yHX\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 01:27:03 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 4BAD54BAE7F8\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 15:27:01 +0000 (GMT)", "from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com\n [205.220.177.32])\n by sourceware.org (Postfix) with ESMTPS id 5F5874B9DB7E;\n Mon, 27 Apr 2026 15:26:28 +0000 (GMT)", "from pps.filterd (m0246630.ppops.net [127.0.0.1])\n by mx0b-00069f02.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63REMVeu1808330; Mon, 27 Apr 2026 15:26:27 GMT", "from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com\n (phxpaimrmta01.appoci.oracle.com [138.1.114.2])\n by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4drm1cubn0-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Mon, 27 Apr 2026 15:26:27 +0000 (GMT)", "from pps.filterd\n (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1])\n by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.7/8.18.1.7)\n with ESMTP id 63RFQBUS009181; Mon, 27 Apr 2026 15:26:26 GMT", "from bn8pr05cu002.outbound.protection.outlook.com\n (mail-eastus2azon11011056.outbound.protection.outlook.com [52.101.57.56])\n by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id\n 4drm2bjqwx-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Mon, 27 Apr 2026 15:26:26 +0000 (GMT)", "from CH0PR10MB5129.namprd10.prod.outlook.com (2603:10b6:610:d8::12)\n by SJ5PPFCC3E08AE4.namprd10.prod.outlook.com\n (2603:10b6:a0f:fc02::7ce) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9846.26; Mon, 27 Apr\n 2026 15:26:21 +0000", "from CH0PR10MB5129.namprd10.prod.outlook.com\n ([fe80::b7b0:9485:8d1c:d791]) by CH0PR10MB5129.namprd10.prod.outlook.com\n ([fe80::b7b0:9485:8d1c:d791%3]) with mapi id 15.20.9846.025; Mon, 27 Apr 2026\n 15:26:21 +0000" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 4BAD54BAE7F8", "OpenDKIM Filter v2.11.0 sourceware.org 5F5874B9DB7E" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 5F5874B9DB7E", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 5F5874B9DB7E", "ARC-Seal": [ "i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1777303588; cv=pass;\n b=OW9hXbIOza1p80DQDLXDRCynyQjbRzoxcJbSrzr0AIAfLMHDS4Q/R25iJa9kxsN2qTGDP10L0vbtvnkwkS4RP8SMs9Qpw8RNKiU/6TjQjpzv1SqM2LtGivNYbin93SQ8xFisz4xMkq2RS2h/byop3gXHcjBArndxTKSELa/BEsM=", "i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=bWchILItrLcGyF8/oDWOkdAP83uFN1+H0qJEszalhQm9Qs1nvHO/djtNu/d67Jp8cWJZG5iZ+hXD7sciJOwLfdk6oDVDrUOLCjVZlo0FCf1Xcxhj6paoo0xoodyfdPdkdJ2ld52esDDfHeYXMAdBp5Fau0hH9lN2Rqnm7HIyRrmKiuafPeBi1CO6bQNc4rneaWNpFn9nCyZSG7uvCULRxKB0BrL/ZwwEB9OZn+m+QADP+yvGcUJ82MufHzgvoSN4bAY5hDXYBqUg1B8j52DmkIiWANhIjjnoMcZ4m271kOQ27bLSdPH6dxwqFlHqdVHa6G0a7xV/1fS3OkSi03GIIQ==" ], "ARC-Message-Signature": [ "i=2; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777303588; c=relaxed/simple;\n bh=bCnPY5xTR5skd9otC6n44DJfL02kpYyy689H+NHnGt0=;\n h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id:\n MIME-Version;\n b=nClbV+eEAafQowPj3V1PdY11HB076AvN6kuV4JnRBvunQqaFKb94rU/cgkLwYiHQX2xJvMq5qbbbwPwM8wy78KpWS0f2km7pONb6rk0tdINizgjNWvoqk9aYx1yQClCiQWZtqNwWLqlaU+Rh5DtgG2LOIHkKLQuZpk4pWbBRWEA=", "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n 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;\n bh=UhcXS6LnDK93Ic4FvSDw65c7ffZm+ldzA1NCKmgu+qs=;\n b=dVDLsD6z9uXOC+T3QKtbL31fjiOsPCDWZIjbfuYcYdW19QDmyUCLRKMHMUhPqwiQmONn9IpDEs7kpnC1nu5J50u1fx55BdRnhN3aaAYxXPUGQNYawe8QsP7BMmJWo3ezHx0ICxMMiNuyPZ7NjlgroQ0GbYGtCbl4F5pXgcCH4ykv/CkYdX9W5kyc180Qjjo4ueXoHUHc8cWjdcITsZrGcXwjpLTSyQo3F7mJ/9KKEuYMscBeEodl7t93nLauJSd0uqN6HeHrM31I+vFnwuY2hS/aslmStqKr9bKR7CW3G89KiH39S4xX1cGhsGGkje08D44qctssQ421OCARpJMUXQ==" ], "ARC-Authentication-Results": [ "i=2; server2.sourceware.org", "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com;\n dkim=pass header.d=oracle.com; arc=none" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc\n :content-transfer-encoding:content-type:date:from:message-id\n :mime-version:subject:to; s=corp-2025-04-25; bh=UhcXS6LnDK93Ic4F\n vSDw65c7ffZm+ldzA1NCKmgu+qs=; b=k33CGBvZl+I3qbS5SMRZJKtzZC6fms0b\n S5ZhKxNEN7oP/82F6G1D/tZixVPY7dWbyvTBAjjet0A0VvtxKjaSFpFZGqpVAbRm\n ecntRQTNppxqn4VsOQ76+pYGlW9Ak3uCdieD93RMn2K7gcr0AUTS5hPhirpq5AvU\n dASw0FxyxsGtFyFC24pcT1Zjk7DVnnp7j3t+TGa63mTUp0mu9hnIeuVLokfldoVT\n YrYzelIqJFIpa7z3PwLcRwmG/q6/RDS5klbNywCIkZhSKDSvtb+aQX7++nHevAkJ\n mQRTV0gV3etlLNsrl/tfDVyijt2vDiKFOIbYkKUDyfbq9D59iN7kNQ==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=UhcXS6LnDK93Ic4FvSDw65c7ffZm+ldzA1NCKmgu+qs=;\n b=S9whFZ6os1Y9zuDdXibTkX1DT/KaAn+Q4udz8QpUu2EpTKgFgFhXP2zzBQq1EFWcZsQp2OnxvMN345pYSHvLJwEa/ziu3MihvpI6FDFLOtkm676M2MnqHXGs6dv9h2K0u8X28hl8OXPUJaSHAJAu4F56X/QW6/OsfYSsrXIOVKE=" ], "From": "Cupertino Miranda <cupertino.miranda@oracle.com>", "To": "gcc-patches@gcc.gnu.org", "Cc": "david.faust@oracle.com, jose.marchesi@oracle.com,\n elena.zannoni@oracle.com,\n bpf@gcc.gnu.org, Cupertino Miranda <cupertino.miranda@oracle.com>", "Subject": "[PATCH] bpf: Fix bit-field shifting in CO-RE expressions", "Date": "Mon, 27 Apr 2026 16:26:04 +0100", "Message-Id": "<20260427152604.61630-1-cupertino.miranda@oracle.com>", "X-Mailer": "git-send-email 2.30.2", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-ClientProxiedBy": "LO4P265CA0118.GBRP265.PROD.OUTLOOK.COM\n (2603:10a6:600:2c6::8) To CH0PR10MB5129.namprd10.prod.outlook.com\n (2603:10b6:610:d8::12)", "MIME-Version": "1.0", "X-MS-PublicTrafficType": "Email", "X-MS-TrafficTypeDiagnostic": "CH0PR10MB5129:EE_|SJ5PPFCC3E08AE4:EE_", "X-MS-Office365-Filtering-Correlation-Id": "2c23467d-eb91-4c8a-49e9-08dea47155ce", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0", "X-Microsoft-Antispam": "BCL:0;\n ARA:13230040|366016|1800799024|376014|56012099003|18002099003;", "X-Microsoft-Antispam-Message-Info": "\n FNXZlo5sYH3D7aqFCpnEyWLr9lZlA/Sz1ibe0B3UMfnV1cwi4Td5Q9o3e027uQdZ1jGKarEvNqCWmlRE403txZOiziJ4xRm9Y6zDUgGftM3HRT/pLPc079sztJ2gEMkCRisV2j9AOXzBk1R9s0iNlgCn9CZZSMWYSfoyRKDCsATchI6Nyd5PLua57MR2E0Q2BjA4WiMQvBRvMDdq5PGy9c+pqEALsiC60yZDwNbSfRMY3Q+nL0wHU6Ue6RpJBOHN0WUXWoKZswXjJH+mKzdbniMfd0vyMX96kHpf6L5J+kis++x+NL+8KFyqsNcZGV5fKShIlzfF1dAEUEa3gqGjWYSwu/kqGOL+l/TYXsSK0YgndT43TqCcN9ImOAlKPNFuRNoU1+sIw0RZSn6Z0iSKOjfSuNpHYQU51wyE9hru3LzllHEaiBMBnWuJhCHUuFuIo9LV/PFutVydarQAK21hvGXuaGR8vNIPdusBWXLOALQS+bmthZgAwwnTf/hp3yuf2jR7nd9IVdwSMSiAI80nyt+F5AwoLtOLpoRZ6a4WAVWjs8WUsSHA4EZ2YvRlWDEHst3tz95uuASWKiJqGLtpT3S9nZSqo1qtlOag7pbFnZ48+pG5BWIEW00RzKDx9f0M2A/QXxZY8BeYtm+YVMNFPeCjaF0Cs97hdALbexw0s7UhcxRHF71JnrGSx6y57RZe", "X-Forefront-Antispam-Report": "CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:CH0PR10MB5129.namprd10.prod.outlook.com; PTR:; CAT:NONE;\n SFS:(13230040)(366016)(1800799024)(376014)(56012099003)(18002099003);\n DIR:OUT;\n SFP:1101;", "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1", "X-MS-Exchange-AntiSpam-MessageData-0": "\n HlO+BbzRrvCajdwj+wqC1gJYQ671T30u9MywrWTUU9Aqtp8AgCJ+abnzsVni+P/R4GCMELnfKLAG5sgtlssyAbydP24rGiqw+W0wpCUfqVzR7xRKkHD2F6S/nh8jSllo7FJTMcqd8IxpK/SCjwamIxjq8xCyYCNCzTW/bldrtx0YDb+D0HQ0o7ReCiXQmR0WH1ukq6koyYkIcHeud06H1kO48UkyUeGLcjOI4x/4qKNcp+OISNSouTFbMXEeTc4yW7ebVsR7czeK68/LHEWnkUV8ESapQqAzTrJIT8sHvZdVPKn0O7j1i/4CC6/YgdD+1hnsEuzpl6ptHO5S4cxwG2MTv/e8UE6yBvjeDA3oVH4FsVFaYhZqZXDcEEZcLBqIZyNNleh9fKw4jEhH351EZmP8MigYSiY5tDEPqdCd4dyjP5NQuZhwm6Uwd5VSArV9r6CSvgw4rCg9OkPfIgYifBr9f5z2RBvuTDayirBsJ4sEWuYbAnx/FtG10PxElgGxaqUNxOdPJF7phJ1PfTfQCTb2Oli/DU3Kmu4JuRHNBLyKBU6f/RdHwzMjvt4SHJjLjp6bWgsboJKs9wSLX9YTg2Nyx/PB5qxbKlGl3zFdyR1khvr0nKRfSaVGCc0Wz5NJ6z21wpBkGDsRRVP5u6tHMHWLv63NvF6KzQSh8wA2rQPuWd+2M9RfqLUuxsu6CXMItACGH/s6tcBUzErRVQADshcZp3vZuTlY+dfEu2zKhlliQUpV/K+a83QkghrmuHjGav+ZM5iVEYsLD0zeE5VyIPGD74cev7zDcc4dSk6e8BsOV8gGqiQYSXkg4F9gExZp/jugRWxeycVgWbNWaRKIPmnGC7zOGc2ybgQSUuvxUo4e0u8lgI1Km/IDInVS8pYftPX9LWrj7a9XYHspfQEaE/Ygk4lECwqzrp38PppcvbO9nsgZSRt4Zslmkg7ACwHtNlb0Bzf9DOaC8bEq9SMmAOewWF/wLnQp8YDeQEmTSsHGG1T6Dv5Cb8gHeBfiHowr/U29K0lqqUCYezYduBw22g19kRCXmX1Dpv7w5eZR0APzco12i3vIYV/wBM/OMppG+zWB73guTbm7yqGDUe/Q5EcXKM1VjFHsY+1nCGK43BgMUXLmZ/1SfqdgRYetYMifYXHnpHC7PVy5OHadjbbhkQqKhLPH1GSSmMuGIA09gPIxi5mWrC8iMnduTj/8I6KcrC+OYSabKVs3a/IO4nSlUNsKb3+r6PAyWB2MzrfomRBK+jv3MLY+JTg/cBWfaT7CAvBbH52XNYTvM/0CFxxRoSTdZbJLJyj0Hy3ZbtaO/7s8CJzhpHNY2kJX7SrIyBwIUFqHw0fVx6rUdSVdRyKHRiZyx54c81DZyz4x91eZMG4spJATQ92+F99i/ULUUovddgtcZQ1rJ6FSDCIeGFRKscz734kELptifxrLriy7LS0uuMwZ45VJD1velHtK8KiE5ttuq7xEXZceU3+KLzxr+FwsvXTygjyclnyAa5xEWijkaGm90oetEzRlxLbydlKn/1+W6TsoYN0vvhCpQt0iy5u80mLyJE2PqyiTshfrZwMd5wIaZbFLpXYVs62pMXqA+UH9BOQeutTWfpm9+iTFe6nvJ5OPrdUhsiaB+uRF4ix+4IeiJu3JMp/hkRP/vI5EnwNXMsfr7vwaT2C2isqOgSW67GVkwK12pZAZ0Haunz6hgUWz+vUj21DiHRITxKvrwI3X9GzTJtDpQj7oSIG96bEdt46kZ/biEHhnDTuwE08=", "X-Exchange-RoutingPolicyChecked": "\n IHb3XKutvLcZOdfaQWvxE/zWHQBpWqz2Rc07mX1Bb+MfoZwjwl6HHu1wWEMMO6WJ1vzZ/y55/X5eXXPQ8KFmvuhHsxU6XY+UkbTv0kjSrYueuh2a+fYRGrVmlPZRfMmlzgWwOZnHxv5iLuSshaCDOeXELm+6tj6WOQ3Qk7OO7HPtRuM9jyZi19wOaQxCQhpgLhEXGCfZUcg6Fp5BdRonmtRQwB4PBZVr7SykooGFX6HbIBs0vHRxvgETNWm5HXah1pVwgynkUat/WQkzopDHuLPeNdGgty8bBL7wpHKw0eN0tcViITj7izL/Ok83lSxNYrT7v0DhbEnFiTxvAnNjRg==", "X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount": "1", "X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0": "\n HuFef3RPxtwUVkleu/CEgQB2sbv/y1I7d9+I60ZE8xa/PtoaDTyGYkkXcLmTCuB6XAudwKaA1aOJ7yobN+E4+kOknsyrzDjUZZ2oJWQGloRtkewZA/oldiIUIIASnbvOCuoaZ0R9/tjfFnVdaJQy/aEurKDU5EkfSJG8jrVFQONzVZUwzlEuZXAsd2CTCby7OF1YmihlcS7XJReC9JvWLfyttkNTrgf6W5WRG0V+JKcylx3Jzrc5xaZRLgcJnwoMYJws5W9QhO9fTogSw6xGD4pa0y0RVgAg4RYi4ueIpMtlyyOWCrja4WH/xkGprkRG53G+qgYaE4/zwPuVE37Diy1yl5kshKaOBOX4PRb8F44fnd2szGmcPbz+hgqNYZbwHN+6eZToTUG8HFRhWjW3aNWeAcJlnS/OaWABe4iip27CrR/AVPnQ4/bBBI9SK3lo1EDsD/H+0E3Czh/9oChrNOmkdacbfWttwYkmVFyNTXCB6/5MRvQv0OnKeF0Rw9yYaTtUB07njHpu73c28VhqqzyUjfJShKJvJBzQvnL821GOTC5EG234cMQDgv20ejvdRBCQwLcCoraCynagkKXiWd9f4u5+7A/tGZdRqIYpxfo=", "X-OriginatorOrg": "oracle.com", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 2c23467d-eb91-4c8a-49e9-08dea47155ce", "X-MS-Exchange-CrossTenant-AuthSource": "CH0PR10MB5129.namprd10.prod.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Internal", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "27 Apr 2026 15:26:21.5782 (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": "\n VUX2UokOn6RZczcf8yGN2kWyi6ihDurn+tHDTHsO2tUE1pL/B19V9fL5YteTPBfw2FXGKSECyc58xb5sP8HhKa428NeZAs8hZdkPVLI0KgY=", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "SJ5PPFCC3E08AE4", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-27_04,2026-04-21_02,2025-10-01_01", "X-Proofpoint-Spam-Details": "rule=notspam policy=default score=0 bulkscore=0\n mlxscore=0 malwarescore=0 adultscore=0 spamscore=0 suspectscore=0\n mlxlogscore=999 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0\n reason=mlx scancount=1 engine=8.19.0-2604200000 definitions=main-2604270165", "X-Proofpoint-GUID": "Vx695lj4ohAe99IyqqAm2ZCa5ZcnW_f_", "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDI3MDE2NSBTYWx0ZWRfX5cQB9X/g8YIW\n GY9dwIW2kD2RqNIEFeo8FwDKw80nn0GHDLAqXhHq8iHdoIYnGVVOCi4S0/7dRiLO3xLKvKSBWVK\n zKHlaV1GOKLn8VFSb04l+MJ1yIqnO3spJd8d8lA+8aU4VmY97c9r3IYACNXcDDKRvm6PHEdTYYT\n N7JE3PWzagtJ/mnUjJzZJr5zlqBcxKUVWx08FCuYHJkXLifnf1hNpbFJVn6Dr1cWPunm5Zxbjcw\n Ho8d/GTShQK78S9K0zkVUWQfOjGRz+y++bOwhuyjeO635+u+egsps/CKHJbnVekHnf57NZNyVQv\n sLduETRn4Xc9Udz5ZegZRfTZ6C5896ED1qvOUTbUgk/2CeIS7jt86NCsGGKGxa9e9ManbF59Ps1\n fLE/R5qYFBK3ZicwQtTexkF3C0NjrlOGdB54szQmeRZfAOOzJS/6FZ2H15O8bbYHagLzieYHJ+1\n PpEZRifmZC9PeQ+Z31Q==", "X-Authority-Analysis": "v=2.4 cv=I89Vgtgg c=1 sm=1 tr=0 ts=69ef8023 cx=c_pps\n a=XiAAW1AwiKB2Y8Wsi+sD2Q==:117 a=XiAAW1AwiKB2Y8Wsi+sD2Q==:17\n a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19\n a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10\n a=GoEa3M9JfhUA:10 a=VkNPw1HP01LnGYTKEx00:22 a=jiCTI4zE5U7BLdzWsZGv:22\n a=x4eqshVgHu-cdnggieHk:22 a=-TY4xITaNF4mdRrkLb8A:9 a=O8hF6Hzn-FEA:10", "X-Proofpoint-ORIG-GUID": "Vx695lj4ohAe99IyqqAm2ZCa5ZcnW_f_", "X-BeenThere": "gcc-patches@gcc.gnu.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Gcc-patches mailing list <gcc-patches.gcc.gnu.org>", "List-Unsubscribe": "<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>", "List-Archive": "<https://gcc.gnu.org/pipermail/gcc-patches/>", "List-Post": "<mailto:gcc-patches@gcc.gnu.org>", "List-Help": "<mailto:gcc-patches-request@gcc.gnu.org?subject=help>", "List-Subscribe": "<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org" }, "content": "Hi David, everyone,\n\nHere is the v2 for this patch.\nApologies for the long wait.\n\nThe walk_subtrees type must be of type int*.\nPlease notice the function defitions need to match what is\ndefined/expected by walk_tree function.\n\nI changed the 0's to false in any case.\n\nI still did not do any work on the runtime testing.\nPromisse to do it some time soon.\n\nLooking forward to your feedback.\n\nCheers,\nCupertino\n\n\nThis patch corrects GCC to do proper bit shifting for bit-field access\nexpressions that get patched for CO-RE access.\nSince we convert field accesses in an early pass, we needed to\nexplicitly generate shifting and masking to properly access the\nbit-fields.\n\ngcc/ChangeLog:\n\n\tPR target/123894\n * config/bpf/core-builtins.cc\n\t (core_expr_with_field_expr_plus_base): Add parameter to return\n\t the tree node for the type associated with the access mode.\n\t (gen_mask_for_size): New function\n\t (gen_rhs_bitfield_adjust): Add function to adapt bitfield accesses\n\t through shifting and masking.\n\t (gen_lrhs_bitfield_adjust): Add function to adapt bitfields in rhs\n\t when a core expression is used in a lhs assignment.\n\t (requires_bitfield_adjust): Add function to verify if an\n\t expression requires bitfield adaptation.\n\t (replace_core_access_index_comp_expr): Add logic for bitfield\n\t adaptation.\n (core_make_builtins): Refactor gimplification. Do bitfield\n\t adjusting.\n\ngcc/testsuite/\n\n\t* gcc.target/bpf/core-bitfields.c: Added new test.\n---\n gcc/config/bpf/core-builtins.cc | 229 +++++++++++++++---\n gcc/testsuite/gcc.target/bpf/core-bitfields.c | 57 +++++\n 2 files changed, 257 insertions(+), 29 deletions(-)\n create mode 100644 gcc/testsuite/gcc.target/bpf/core-bitfields.c", "diff": "diff --git a/gcc/config/bpf/core-builtins.cc b/gcc/config/bpf/core-builtins.cc\nindex d0c6cfdaf1c0..c55245179ad0 100644\n--- a/gcc/config/bpf/core-builtins.cc\n+++ b/gcc/config/bpf/core-builtins.cc\n@@ -1333,6 +1333,16 @@ core_expr_with_field_expr_plus_base (tree base, tree expr, bool leaf_node)\n tree type = TREE_TYPE (expr);\n tree args[2];\n \n+ tree mem_access_type = lang_hooks.types.type_for_mode (TYPE_MODE (type),\n+\t\t\t\t\t\t\t TYPE_UNSIGNED (type));\n+\n+ /* Only use mode type for integer types, where the value can be a bitfield\n+ access. */\n+ if (TREE_CODE (type) != INTEGER_TYPE)\n+ mem_access_type = type;\n+\n+ mem_access_type = build_pointer_type (mem_access_type);\n+\n if (base == expr)\n return expr;\n else if (TREE_CODE (expr) == ARRAY_REF\n@@ -1366,12 +1376,13 @@ core_expr_with_field_expr_plus_base (tree base, tree expr, bool leaf_node)\n \t\t\t fold_build1 (NOP_EXPR, ptr_type_node, base),\n \t\t\t offset);\n \n- tmp = fold_build1 (NOP_EXPR, build_pointer_type (type), tmp);\n+ tmp = fold_build1 (NOP_EXPR, mem_access_type, tmp);\n return tmp;\n }\n else\n {\n tree fndecl = bpf_builtins[BPF_BUILTIN_PRESERVE_FIELD_INFO];\n+\n args[0] = expr;\n args[1] = build_int_cst (integer_type_node, BPF_FIELD_BYTE_OFFSET);\n tree builtin_call = construct_builtin_core_reloc (UNKNOWN_LOCATION,\n@@ -1385,7 +1396,7 @@ core_expr_with_field_expr_plus_base (tree base, tree expr, bool leaf_node)\n tree tmp = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node,\n \t\t\t fold_build1 (NOP_EXPR, ptr_type_node, base),\n \t\t\t fold_build1 (NOP_EXPR, size_type_node, builtin_call));\n- tmp = fold_build1 (NOP_EXPR, build_pointer_type (type), tmp);\n+ tmp = fold_build1 (NOP_EXPR, mem_access_type, tmp);\n return tmp;\n }\n }\n@@ -1502,17 +1513,142 @@ make_core_safe_access_index (tree expr, bool *changed, bool entry = true)\n return ret;\n }\n \n+/* This functions creates a tree node with a constant mask value for a\n+ particular type and size. */\n+static tree\n+gen_mask_for_size (tree type, poly_int64 bitsize)\n+{\n+ tree mask = build_int_cst (type, 1);\n+ mask = fold_build2 (LSHIFT_EXPR, type, mask,\n+\t\t build_int_cst (type, bitsize));\n+ mask = fold_build2 (MINUS_EXPR, type, mask,\n+\t\t build_int_cst (type, 1));\n+ return mask;\n+}\n+\n+/* This function performs tree changes to bitfield CO-RE\n+ expressions. */\n+static tree\n+gen_rhs_bitfield_adjust (tree bit_type, tree mem_access_type,\n+\t\t\t tree mem_ref, tree offset, tree sizemask)\n+{\n+ tree value = mem_ref;\n+\n+ /* Shift read value to position it in least significant bits. */\n+ if (TREE_INT_CST_LOW (offset) != 0)\n+ value = fold_build2 (RSHIFT_EXPR, mem_access_type, value, offset);\n+\n+ value = fold_build2 (BIT_AND_EXPR, mem_access_type, value, sizemask);;\n+ /* The casting takes care of the sign extension. */\n+ value = fold_build1 (NOP_EXPR, bit_type, value);\n+ return value;\n+}\n+\n+/* This function performs tree changes to bitfield assignement (LHS and RHS)\n+ CO-RE expressions. It needs to perform bit shifting and masking to\n+ read the data, clear the respective bits, and assign the value in the proper\n+ bit location. */\n+static tree\n+gen_lrhs_bitfied_adjust (tree mem_access_type, tree mem_ref, tree lhs,\n+\t\t\t tree offset, tree bitmask)\n+{\n+ /* Mask to clear bits in destination bitfield. */\n+ tree clear_mask = fold_build2 (LSHIFT_EXPR, mem_access_type, bitmask, offset);\n+ clear_mask = fold_build1 (BIT_NOT_EXPR, mem_access_type, clear_mask);\n+\n+ /* Collect the value from the pointer reference. */\n+ tree read_value = fold_build2 (BIT_AND_EXPR, mem_access_type, mem_ref,\n+\t\t\t\t clear_mask);\n+\n+\n+ tree new_value = lhs;\n+ if (TREE_CODE (lhs) == NOP_EXPR\n+ && TREE_TYPE (TREE_OPERAND (lhs, 0)) == mem_access_type)\n+ new_value = TREE_OPERAND (lhs, 0);\n+ new_value = fold_build1 (NOP_EXPR, mem_access_type, new_value);\n+ new_value = fold_build2 (BIT_AND_EXPR, mem_access_type, new_value, bitmask);\n+ new_value = fold_build2 (LSHIFT_EXPR, mem_access_type, new_value, offset);\n+\n+\n+ new_value = fold_build2 (BIT_IOR_EXPR, mem_access_type, read_value,\n+\t\t\t new_value);\n+ return new_value;\n+}\n+\n /* This function verifies if the NODE expression is a field expression and\n changes and converts it to CO-RE. This is used by a tree walker for any\n __builtin_preserve_access_index argument expression from within\n bpf_resolve_overloaded_core_builtin. */\n \n+static bool\n+requires_bitfield_adjust (tree node, tree *p_mem_access_type,\n+\t\t\t tree *offset, tree *bitmask)\n+{\n+ poly_int64 bitsize, bitpos;\n+ tree var_off;\n+ machine_mode mode;\n+ int sign, reverse, vol;\n+\n+ get_inner_reference (node, &bitsize, &bitpos, &var_off, &mode,\n+\t\t &sign, &reverse, &vol);\n+\n+ tree type = TREE_TYPE (node);\n+ tree mem_access_type = lang_hooks.types.type_for_mode (TYPE_MODE (type),\n+\t\t\t\t\t\t\t TYPE_UNSIGNED (type));\n+ *p_mem_access_type = mem_access_type;\n+\n+ /* Only use mode type for integer types, where the value can be a bitfield\n+ access. */\n+ if (TREE_CODE (type) != INTEGER_TYPE)\n+ return false;\n+\n+ if (TYPE_MAIN_VARIANT (type) != TYPE_MAIN_VARIANT (mem_access_type))\n+ {\n+ *offset = fold_build2 (TRUNC_MOD_EXPR, mem_access_type,\n+\t\t\t build_int_cst (mem_access_type, bitpos),\n+\t\t\t TYPE_SIZE (mem_access_type));\n+\n+ *bitmask = gen_mask_for_size (mem_access_type, bitsize);\n+\n+ return true;\n+ }\n+\n+ return false;\n+}\n+\n static tree\n replace_core_access_index_comp_expr (tree *node, int *walk_subtrees,\n-\t\t\t\t void *data ATTRIBUTE_UNUSED)\n+\t\t\t\t void *data)\n {\n bool valid = true;\n gcc_assert (*node != NULL_TREE);\n+ bool is_lhs = (bool) data;\n+ tree mem_access_type, offset, bitmask;\n+\n+ if (TREE_CODE (*node) == MODIFY_EXPR\n+ && requires_bitfield_adjust (TREE_OPERAND (*node, 0), &mem_access_type,\n+\t\t\t\t &offset, &bitmask))\n+ {\n+ TREE_VISITED (*node) = 1;\n+ walk_tree (&TREE_OPERAND (*node, 0), replace_core_access_index_comp_expr,\n+\t\t (void *) true, NULL);\n+ walk_tree (&TREE_OPERAND (*node, 1), replace_core_access_index_comp_expr,\n+\t\t NULL, NULL);\n+\n+ TREE_TYPE (*node) = TREE_TYPE (TREE_OPERAND (*node, 0));\n+ TREE_OPERAND (*node, 1) = gen_lrhs_bitfied_adjust (mem_access_type,\n+\t\t\t\t\tTREE_OPERAND (*node, 0),\n+\t\t\t\t\tTREE_OPERAND (*node, 1),\n+\t\t\t\t\toffset, bitmask);\n+\n+ *node = fold_build2 (MODIFY_EXPR,\n+\t\t\t TREE_TYPE (TREE_OPERAND (*node, 0)),\n+\t\t\t TREE_OPERAND (*node, 0),\n+\t\t\t TREE_OPERAND (*node, 1));\n+\n+ *walk_subtrees = false;\n+ return NULL_TREE;\n+ }\n \n tree *expr = node;\n bool should_indirect = false;\n@@ -1525,18 +1661,29 @@ replace_core_access_index_comp_expr (tree *node, int *walk_subtrees,\n if (valid == true && n > 0)\n {\n bool changed = false;\n- tree expr_test = make_core_safe_access_index (*expr, &changed);\n- *walk_subtrees = 0;\n+ tree expr_test = make_core_safe_access_index (*expr, &changed, true);\n+ tree access_type = TREE_TYPE (expr_test);\n \n if (changed == true)\n \t{\n \t if (should_indirect == true)\n \t expr_test = fold_build1 (INDIRECT_REF,\n-\t\t\t\t TREE_TYPE (TREE_TYPE (expr_test)),\n+\t\t\t\t TREE_TYPE (access_type),\n \t\t\t\t expr_test);\n \n+\t if (is_lhs == false\n+\t && requires_bitfield_adjust (*node, &mem_access_type, &offset,\n+\t\t\t\t\t &bitmask))\n+\t {\n+\t tree orig_type = TREE_TYPE (*node);\n+\t expr_test = gen_rhs_bitfield_adjust (orig_type, mem_access_type,\n+\t\t\t\t\t\t expr_test, offset, bitmask);\n+\t }\n+\n+\n \t *expr = expr_test;\n \t}\n+ *walk_subtrees = false;\n }\n return NULL_TREE;\n }\n@@ -1896,48 +2043,72 @@ core_make_builtins (tree *tp, int *walk_subtrees, void *data)\n expr = TREE_OPERAND (*tp, 0);\n }\n \n+ poly_int64 bitsize, bitpos;\n+ tree var_off;\n+ machine_mode mode;\n+ int sign, reverse, vol;\n+\n+ tree base = get_inner_reference (expr, &bitsize, &bitpos, &var_off, &mode,\n+\t\t\t\t &sign, &reverse, &vol);\n+\n if (is_attr_preserve_access (expr)\n && (n = compute_field_expr (expr, NULL, &valid, NULL)) > 0\n && valid == true)\n {\n- poly_int64 bitsize, bitpos;\n- tree var_off;\n- machine_mode mode;\n- int sign, reverse, vol;\n-\n- tree base = get_inner_reference (expr, &bitsize, &bitpos, &var_off, &mode,\n-\t\t\t\t &sign, &reverse, &vol);\n-\n+ tree access_type = NULL_TREE;\n tree new_expr = core_expr_with_field_expr_plus_base (base, expr, true);\n \n /* Abort convertion if it is just a pointer or a reference to an\n \t attributed type. */\n if (new_expr != expr)\n \t{\n-\n \t gimple_seq before = NULL;\n+\t gimple_seq after = NULL;\n \t push_gimplify_context ();\n-\n \t gimplify_expr (&new_expr, &before, NULL, is_gimple_val, fb_rvalue);\n \n \t tree new_expr_type = TREE_TYPE (new_expr);\n-\n-\t /* Replace original expression by new_expr. If the type is the same\n-\t tree node, good! If it is a pointer type, we need to dereference\n-\t the type within the pointer to guarantee it is the same. */\n-\t if (TREE_TYPE (new_expr) == TREE_TYPE (*tp)\n-\t || (is_addr_expr\n-\t\t && TREE_TYPE (new_expr_type) == TREE_TYPE (expr)))\n-\t *tp = fold (new_expr);\n-\t else if (TREE_TYPE (new_expr) == build_pointer_type (TREE_TYPE (*tp)))\n-\t *tp = fold_build2 (MEM_REF, TREE_TYPE (*tp),\n-\t\t\t new_expr, build_int_cst (ptr_type_node, 0));\n+\t tree mem_access_type, offset, bitmask;\n+\n+\t if (requires_bitfield_adjust (*tp , &mem_access_type, &offset,\n+\t\t\t\t\t&bitmask))\n+\t {\n+\t tree value = build_simple_mem_ref (new_expr);\n+\t if (wi->is_lhs)\n+\t\t{\n+\t\t gcc_assert (is_gimple_assign (wi->stmt));\n+\t\t tree *rhs = gimple_assign_rhs1_ptr (wi->stmt);\n+\n+\t\t *rhs = gen_lrhs_bitfied_adjust (mem_access_type,\n+\t\t\t\t\t\t value, *rhs, offset,\n+\t\t\t\t\t\t bitmask);\n+\t\t gimplify_expr (rhs, &before, &after, is_gimple_val,\n+\t\t\t\t fb_rvalue);\n+\t\t}\n+\t else\n+\t\t{\n+\t\t value = gen_rhs_bitfield_adjust (TREE_TYPE (*tp),\n+\t\t\t\t\t\t mem_access_type,\n+\t\t\t\t\t\t value, offset, bitmask);\n+\t\t gimplify_expr (&value, &before, NULL, is_gimple_val,\n+\t\t\t\t fb_rvalue);\n+\t\t}\n+\t *tp = value;\n+\t }\n \t else\n-\t gcc_assert (0);\n+\t {\n+\t if (TYPE_MAIN_VARIANT (new_expr_type) != TYPE_MAIN_VARIANT (\n+\t\t\t\t\t\t TREE_TYPE (*tp))\n+\t\t&& !is_addr_expr)\n+\t new_expr = build_simple_mem_ref (new_expr);\n+\n+\t new_expr = fold (new_expr);\n+\t *tp = new_expr;\n+\t }\n \n \t gsi_insert_seq_before (&(wi->gsi), before, GSI_SAME_STMT);\n+\t gsi_insert_seq_after (&(wi->gsi), after, GSI_SAME_STMT);\n \t pop_gimplify_context (NULL);\n-\n \t *walk_subtrees = false;\n \t}\n }\ndiff --git a/gcc/testsuite/gcc.target/bpf/core-bitfields.c b/gcc/testsuite/gcc.target/bpf/core-bitfields.c\nnew file mode 100644\nindex 000000000000..6cbaf1035fb4\n--- /dev/null\n+++ b/gcc/testsuite/gcc.target/bpf/core-bitfields.c\n@@ -0,0 +1,57 @@\n+/* Test for BPF CO-RE __attribute__((preserve_access_index)) with accesses on\n+ LHS and both LHS and RHS of assignment. */\n+\n+/* { dg-do compile } */\n+/* { dg-options \"-O2 -dA -gbtf -mco-re -masm=normal\" } */\n+\n+struct S {\n+ unsigned char a: 2;\n+ unsigned char b: 2;\n+ unsigned char c: 2;\n+ unsigned char d: 2;\n+} __attribute__((preserve_access_index));\n+\n+struct S_no {\n+ unsigned char a: 2;\n+ unsigned char b: 2;\n+ unsigned char c: 2;\n+ unsigned char d: 2;\n+};\n+\n+char foo (struct S *s, struct S_no *s_no, unsigned char v)\n+{\n+ unsigned char z = s->c;\n+ s->b = v;\n+\n+ return z;\n+}\n+char bar (struct S_no *s_no)\n+{\n+ unsigned char y = __builtin_preserve_access_index (s_no->d);\n+ return y;\n+}\n+\n+/* { dg-final { scan-assembler-times \"ascii \\\"0:1.0\\\"\\[\\t \\]+\\[^\\n\\]*btf_aux_string\" 1 } } */\n+/* { dg-final { scan-assembler-times \"ascii \\\"0:2.0\\\"\\[\\t \\]+\\[^\\n\\]*btf_aux_string\" 1 } } */\n+/* { dg-final { scan-assembler-times \"ascii \\\"0:3.0\\\"\\[\\t \\]+\\[^\\n\\]*btf_aux_string\" 1 } } */\n+\n+/* { dg-final { scan-assembler-times \"bpfcr_astr_off \\\\(\\\"0:1\\\"\\\\)\" 1 } } */\n+/* { dg-final { scan-assembler-times \"bpfcr_astr_off \\\\(\\\"0:2\\\"\\\\)\" 1 } } */\n+/* { dg-final { scan-assembler-times \"bpfcr_astr_off \\\\(\\\"0:3\\\"\\\\)\" 1 } } */\n+/* { dg-final { scan-assembler-times \"bpfcr_type \\\\(struct S\\\\)\" 2 } } */\n+/* { dg-final { scan-assembler-times \"bpfcr_type \\\\(struct S_no\\\\)\" 1 } } */\n+\n+/* In foo */\n+\n+/* { dg-final { scan-assembler-times \"rsh32\\t%r0,4\" 1 } } */\n+/* { dg-final { scan-assembler-times \"lsh32\\t%r3,2\" 1 } } */\n+/* { dg-final { scan-assembler-times \"and32\\t%r3,12\" 1 } } */\n+/* { dg-final { scan-assembler-times \"and32\\t%r4,-13\" 1 } } */\n+/* { dg-final { scan-assembler-times \"and32\\t%r0,3\" 1 } } */\n+/* { dg-final { scan-assembler-times \"or32\\t%r4,%r3\" 1 } } */\n+\n+/* In bar */\n+\n+/* { dg-final { scan-assembler-times \"rsh32\\t%r0,6\" 1 } } */\n+\n+\n", "prefixes": [] }