From patchwork Fri Sep 27 16:49:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cupertino Miranda X-Patchwork-Id: 98077 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 668A7385EC1E for ; Fri, 27 Sep 2024 16:50:33 +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 4AF3D3858D39 for ; Fri, 27 Sep 2024 16:49:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4AF3D3858D39 Authentication-Results: sourceware.org; dmarc=pass (p=reject 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 4AF3D3858D39 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=1727455801; cv=pass; b=dyOrLpZwxENWfOJmD1mxNWgExGTfR95PHOz2BMh1VCIQQG8IU/AcD927ezosIS3y9q0MJ27dxIcCm5EC4oIlyGNa0lsWUIQ+C1VgAlQvGO+vcv3s7RLW1UxxbgGARGuSLAVpgQ1qKdoBXcV8cuCF7Dp2pVOrDg9RW1QMRjJ2BpY= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1727455801; c=relaxed/simple; bh=NxGykaGQQxL743Z0Wsv+EC/Ps2cm0WZ9ySh6kKN4qPA=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=HGIUDhBMBfStHYkO2kzPHkcYsd2HoyxAoMHbtx1p1EvGGtKqPIIp28LUCNEmgj0NxZ60O2Z6LphJd+eNSeJMbEa+Qh92drq9AqzBOA5MuJCmKsAx/5N/gd63aeQG7Uuknp/8560+Mmn9w70qFimLmKNulWimLc+ATA+/uzSnmrg= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48RGBe1x004149 for ; Fri, 27 Sep 2024 16:49:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=/A+qmA++RddIutH+srKpwkGtwsZeZqI4temFKNlez4A=; b= REL3KvytOdZ9/0NdG6ZYgJKzwO70cKwxClfIsPYpKE9MyZ+az7qenF0ncI9SvQZq GFstr5Y6iEXKkGhc62s2pCFVaqmy4LGRd1qyD8RP6ymhZ3lMkq/8TQ89TvlRObmn U1GQ/Ndmt9nFTdsNONjXh9rh+ILYdC/K01fhaZ0hphGgPnTovhxakXFZs4XMQ/6S qCKnNL/T59K8HiUTO+88RjR712/S3cMnIJyRiP5AD2z2ulSu0ZuYQmQ4isyp8E6r zLqYwyqZai9OOYkDG6kqndJlmzkn0+gY2//lvQINRzsCFiwV05Bw8oEO8LFxM9u8 RNymmxNluXfKvbeoKaHhMA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41smx3dq2v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 27 Sep 2024 16:49:57 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48RFaipf030385 for ; Fri, 27 Sep 2024 16:49:57 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41smkdwcqy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 27 Sep 2024 16:49:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=x2STNZLyjsRFpzX9kkaOHmzskbDvPlvEuyQCBYKGS76jRXFH++VFeAIDIvKzuw5CsSwEFyT4n8Wf4DSY6rVudSrjjxys6lSOzj0Kwnw1lScDnIJ7I77n1mc0RyQY7Q2+GfxryxrYGveU4k2+mApdbhRCGtkuoQFsct5ZKzSaIbzlZ3XhP91KXDLDJKw+4cI8sihtUkuuiBsnCS8P21WTwSTSZ0nQ40CjOIZLOu62mU+BlbUefVGzQ4Slocru+H8uUU2KaheJLJkFoUCVhEysvxPHh2aM5FEbXKujJXfL2LXGwwCglHGDu2R+qAJ7m6SZQZqIRCZfQzqP4yyZUHPS7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=/A+qmA++RddIutH+srKpwkGtwsZeZqI4temFKNlez4A=; b=YzYxNc3bPb1uTkw8kC4LRJEPpncIspqmDX1ezAJ40cDUO2+ZrHEHUP99gPHySijEor+70R3heehq0YZ195id6mXUuJZwl7ZAH9UJE/ItV1sq4oaCwQe610iiCQEpK4Sr63pHYQoNF+4cZrYzxjRuA7+2tWNOoydM9u/76WXHj2o/LcsHCviRctaSZwwfaoyka/gWVg5WB5hNzfl7fBkmBRAE53HLMmgHbX8xbWv+nsjjtPrVK28iulkFgmez/bCHCKi8XYEyHHTervey/ZW79ZR/xs+b8S7ULhGlXm6lTSJWi7Za4KiKdNjq5su91UJdBQQetLqlBb+P/8x8iLSn6g== 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=/A+qmA++RddIutH+srKpwkGtwsZeZqI4temFKNlez4A=; b=l8pf6b4A3Ovy0AVsEGXxZ2WzKbjrhIskKuBqaD6CtopuQdCws/rJcLmqduHFfU+15J0CLgNsPz/m5tyLxcDDD/pSNFnso1CXodKej85mjQRES42lYUOWEr9WvG0HtRfUZ5ALOyiLMKbCuVAM0ag0rqbILWWdIi+9NccnGzALlRo= Received: from MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) by SN4PR10MB5606.namprd10.prod.outlook.com (2603:10b6:806:209::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.8; Fri, 27 Sep 2024 16:49:54 +0000 Received: from MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::5033:84a3:f348:fefb]) by MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::5033:84a3:f348:fefb%2]) with mapi id 15.20.8026.005; Fri, 27 Sep 2024 16:49:54 +0000 From: Cupertino Miranda To: gcc-patches@gcc.gnu.org Cc: jose.marchesi@oracle.com, david.faust@oracle.com, elena.zannoni@oracle.com, Cupertino Miranda Subject: [PATCH 3/3] bpf: set index entry for a VAR_DECL in CO-RE relocs Date: Fri, 27 Sep 2024 17:49:17 +0100 Message-Id: <20240927164917.141266-4-cupertino.miranda@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240927164917.141266-1-cupertino.miranda@oracle.com> References: <20240927164917.141266-1-cupertino.miranda@oracle.com> X-ClientProxiedBy: LO4P123CA0006.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:150::11) To MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR10MB4382:EE_|SN4PR10MB5606:EE_ X-MS-Office365-Filtering-Correlation-Id: 33465bcf-892f-4d42-4452-08dcdf1469bd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|10070799003|366016; X-Microsoft-Antispam-Message-Info: 2NVZ5omiORwQ3vLDY4JQhehqDzXfkmjRqQD0LI8I9YvdAqGsfxdaEW/NpHb6wyu/dpD6x8v6FtgEyx99MBcTCnPqLlv4hy92b2uPHt2q5MtdQJaCsy/CasO1u2VUs41ZhRoZGuBK1XJSt5gD8PqNryVi3auVcCeNzXxxehFsaaTnM62W+BzZxoOZnvSj2Fo6ixM3DEzhvq8SnI4er69zk/3HjSQobE3Va0D1tL0gTY6l6ByXxXF2RyONIy7eERemS8AcPppRHNf+gkXcPBKUUM6ChQjo8t4y7iIubqHzB1S2i9j5Y7QYkW+UIU7SboB4D2AQzJ+x/PNuOF4ALSzjkeFlEhZO9YxAW14X822Vt4bjK6TuDAVgZUx5wkJUp5RSSCKz08Jo0hXtVbWJGEcWjIa5gvjINyCuwDQmwRQN0R4wzEvB4yRq3aZUDPhhIWm6dt6tY6aAy9WFaZ22qmsCw+JZ2f/66zTriNNviKuA4K7BewLXQseCjvFzSifrQQai+YHbaUbHJ5uE46rPkuXemh4ryDFQdG9++JAGllHEz/KGHlIpttliVVJTVIUJTO6iXVESG4/BFHCJSWYYs3draXKilE0DjvszqRO36DmpCrJX0pgZBohxuPtKtkEicM78ME33E9qOf85aSAMgzGrmbSw/nwAdkB1YLbSqGZ/i1ziwaYenqx3BRR2o5tc36PD1HMmJ2QxgU62NcHWTJG4aVfgRRNQhstOv4vBxRCSerKwhnGk5rH39/crOC3dqb6mJXmaqdf2hkFGpMu2M5XnK63vg8T7upduZ6x6O40d02+wcjavuUVBxutEOH+u02wTWSC4hE/498tNsCKbHnUz4Wk97sIi/Jfwyx+O+/HcMf777idppnVd76hfPbso0euQFpMRlyo/9475yKYpuJMiSmy2KG1jRoq7AJA8+ggCcP8V6+90EPxydaJetk4gXYDkdorJR6V344VQED8iYxi9ojBpaqjYQDSUE+i2pZfoUXvIoDZvyrJv3JAR91k+mrh/LjDv0zFlNyAISr97OOmWBlwd5KkIKm6YHNPlKbDPcQDu/4Qw6ilqdx633wJx/Z/iON5Avz4I3JZXg2OAKUmYyqmgyGLDpwsT0qLvJ7sCw3Kb+iSphjthfdeC18XA4D56nuT+kLeKtIDU2DLOfUHkdy8AlIcqcvvxWc2laBCozkdKJo2TY8PHBI5QVo3yGxC9KVHkFfiXI68QaEYhX/2FeNBjI6KVKamrtMqv2d6dxW2/W4HaQjMZLqXTNhKo4Q4wDheahXNrrinOPUUISJKlDueF3YdBLeLPQYe80Yln9BcH+7cnJyxbmMbC6SBPJpybZGAa7ypU8r4xEw+c/O++MeA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR10MB4382.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(10070799003)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: piUMyUS2QtS5+G/uS9dnket7WzjsQlDnKo7HaMnsVAxYXIaLJknegrvgNqj0UwSRtp3FCdcsYj2NtUdqsHBviG5ZNrj8XY26sITuWr/mKvePu1nQ0FNejZ7s43P8TIUYd0YfsSy1iF0gbazFvNKGbCmddntgYSm8p2NTegwFkZa/JkVPbXRONAKgto5bPQeXQM859SVF8/BeBc80J14iS7TZ7p7A4Gw26CwYyGAH//UuzwuI9nE7bfZlL7oCFLGxrbPwH/LgUZHrS1qEssVCPAdax5rAmHNcnVxJ7Bc6IVJ7tOs9DqyIchxWNEbQepb9PZ69gXGGyMNNJHzGKs9dyElhO/vsaz32IQeCm5qc8MksPAsghcf6B04SDFhU4s4ocpVDTAo+/Hw+uaP3RDmhAvyPl5LqYpQ1LAce4flAzbG1tok95f9QDNIDjXWDNbTynKTfRB7VK+BjlVkbmgkn6Ml3VrPTn+ThniAwKqrCAe6eyoZrEh8P6JArDo1YwkTY34HPobm15Azm53vfoWD34a5CLxemxpEjAnxTCdqFqK6c+g7y0bfWawmBbuBk9u0LE/VIVVZCbPPEgdcNuR6U3qeI7zVUCDm0ZqgalCwxPf9SVqBmhhujk490Zjynj5u9HErq4H7/iQNWz4gaw3DCZL/EjHIIkSIzpXePtu/uLIGMHKOFKpSgXEH0aIVNRgvnMOxL5S2ZcpX6o1XijSKOchUO8tqJTSm/dfs87xcttu1guCuBvCTcMFM07k+K+ACC7nmXyRviXBIdA4lfaJ4g3f87/jwUY5yquydu3oTlFlO1eyegWr9I0i0M1ZoOq/ULs68HIJakjh4SVZsZ/DWEHoNo/pFbI549f6N/JiBzEvQ9f/gbQYX+okNbslToR+7tWzWxaR55I5HF08j5P13VgJgTrwtTVlo9hhGevctOqKwo4VKSFf017X6X6piVM601BrR2c7i7u2qBnXANrnds4RPEZRi/X3ZZHJwYvI1LFoVjZ85/2RAJ5BUyq0iAzMkhUcbOkc8GHyeS5OXjd3gW3y7AKS2qdIBdt0vmv91RcQHys3EnTolBa5VoNsxdtXRAjtDpqlPHBvCtlU+rbON6PinijhDS4pVL0l1ZBkR8v0pndZ45uQ0JlS3V1WrFZHxawI3OgY13qH/X74x46ZcvhjB9eRpHOpHEyPE3om3PN+4umkcXH23+7dtsBWfr+P5wGLzI7puskyeT9SIo9GFV7DNwk0UzvmJ6kJ/yfYbfk747NCCplflVB6u51BUZCDvim6S+yZkXnQ9L5OMzSp+JSi6slDvr9X9t4chkDGW7Lzf8VQ1FL2Aw1nff2p5CdvHi8OmlVckCaJypIxeb7+U+7MHvNtOBX9wDKyejmQpfXs+/rZbErTi7u07mGRZ/maUhKd/pdCqp1RByZNj9ShOWh56wl4Lt3iR7Op2kQslNYzmAYslEI15C9NvVbPao1r3G3TRGYUt3Riu23Xr9OLayR2ionw8wMrgaG9+Qie6/JqQ3F5BEV+XaiSqOgoEkIMhJjE+/LdV3WEPvh4EEd7xfTFIxeVufPxcYk8M7WJq7gmKRxp7D7vk1P8KNWFyrav4bsaFly2z7VubTFlvQSSKTjE7UG856RRAa8eR37KYqszA= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: w7iy2NBpPXt1Ea0gTh1lu8pgmjvCVO9GZySCmadUWXW4kQ1n2vV5CRZOh6cN6U6l3R3L7VTOo9SPBRz3w6bqzjlAXl8HedfQNRozXVc9Y/bMbXcHbZq+mr4dlonPnhJF07bD5pwnnlotG2Di8KIV9N5MeBVqreTmJwWIZYCG5QUmLCOgnBx2efICPu5jQnBakEMFm6dLNhGe6dAMfIsvh/7zEaBQ0l7CRYkmu1kIO4LhjY66z8ODkKGO20To/Ebx1F5WVE4qMtNXXjqL8JMVYq9DGCNV4A3xJLPj+fLmLkefYFfbbuYBpv809cAVNVeImMGGZtC5GHiNIAGjUH0H6r4OldnYJ1DgcrhJwCW3Xx6Clqp369piTBn+Qbcnn6GSuvmK1JIxNjzOiRcUv8TGoRAAiekpi1w2gD1hUMMb/cewwJFbUnBq49i0kq/kyvVSCXaplVtBB2oJLUGde/2xdz37n/o9S9C4D851QSwiKa313I1Afabed32eqXpmNDKTCPXUVOT4bAg730rP9tCe6Rx/ZGrehokODomfHIU5s+5m35iEHMx0t9nB0qjexV4wWc5gfBUX9+dZiezzi2LI+7uaXVC4LJEAG4+D/ykcQac= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33465bcf-892f-4d42-4452-08dcdf1469bd X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4382.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2024 16:49:54.7581 (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: tGsLlNqenAij+5U/BzMGJpjuSJ/VAZ3AFt3YckJcCKSp+e6mKGctbGw5x0z4RVDIQ1a51xB3vDPcHi5JM9RLA8WAh3sZUpIH2oIvg667IKk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5606 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-27_06,2024-09-27_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 spamscore=0 bulkscore=0 suspectscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409270121 X-Proofpoint-ORIG-GUID: 9HmTmPzVpiEULuZN94T_qg5ZUsqHew0o X-Proofpoint-GUID: 9HmTmPzVpiEULuZN94T_qg5ZUsqHew0o X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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~patchwork=sourceware.org@gcc.gnu.org CO-RE accesses with non pointer struct variables will also generate a "0" string access within the CO-RE relocation. The first index within the access string, has sort of a different meaning then the remaining of the indexes. For i0:i1:...:in being an access index for "struct A a" declaration, its semantics are represented by: (&a + (sizeof(struct A) * i0) + offsetof(i1:...:in) --- gcc/config/bpf/core-builtins.cc | 5 ++++- gcc/testsuite/gcc.target/bpf/core-builtin-1.c | 16 ++++++++-------- gcc/testsuite/gcc.target/bpf/core-builtin-2.c | 3 ++- .../gcc.target/bpf/core-builtin-exprlist-1.c | 16 ++++++++-------- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/gcc/config/bpf/core-builtins.cc b/gcc/config/bpf/core-builtins.cc index cdfb356660e..fc6379cf028 100644 --- a/gcc/config/bpf/core-builtins.cc +++ b/gcc/config/bpf/core-builtins.cc @@ -698,10 +698,13 @@ compute_field_expr (tree node, unsigned int *accessors, access_node, false, callback); return n; + case VAR_DECL: + accessors[0] = 0; + return 1; + case ADDR_EXPR: case CALL_EXPR: case SSA_NAME: - case VAR_DECL: case PARM_DECL: return 0; default: diff --git a/gcc/testsuite/gcc.target/bpf/core-builtin-1.c b/gcc/testsuite/gcc.target/bpf/core-builtin-1.c index b4f9998afb8..0706005f0e5 100644 --- a/gcc/testsuite/gcc.target/bpf/core-builtin-1.c +++ b/gcc/testsuite/gcc.target/bpf/core-builtin-1.c @@ -24,16 +24,16 @@ unsigned long ula[8]; unsigned long func (void) { - /* 1 */ + /* 0:1 */ int b = _(my_s.b); - /* 2 */ + /* 0:2 */ char c = _(my_s.c); - /* 2:3 */ + /* 0:2:3 */ unsigned char uc = _(my_u.uc[3]); - /* 6 */ + /* 0:6 */ unsigned long ul = _(ula[6]); return b + c + uc + ul; @@ -55,10 +55,10 @@ u_ptr (union U *pu) return x; } -/* { dg-final { scan-assembler-times "ascii \"1.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ -/* { dg-final { scan-assembler-times "ascii \"2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ -/* { dg-final { scan-assembler-times "ascii \"2:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ -/* { dg-final { scan-assembler-times "ascii \"6.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:1.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:2:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:6.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:2:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ diff --git a/gcc/testsuite/gcc.target/bpf/core-builtin-2.c b/gcc/testsuite/gcc.target/bpf/core-builtin-2.c index b72e2566b71..04b3f6b2652 100644 --- a/gcc/testsuite/gcc.target/bpf/core-builtin-2.c +++ b/gcc/testsuite/gcc.target/bpf/core-builtin-2.c @@ -16,11 +16,12 @@ struct S foo; void func (void) { + /* 0:1:3:2 */ char *x = __builtin_preserve_access_index (&foo.u[3].c); *x = 's'; } /* { dg-final { scan-assembler-times "\[\t \]0x4000002\[\t \]+\[^\n\]*btt_info" 1 } } */ -/* { dg-final { scan-assembler-times "ascii \"1:3:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:1:3:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "bpfcr_type" 1 } } */ diff --git a/gcc/testsuite/gcc.target/bpf/core-builtin-exprlist-1.c b/gcc/testsuite/gcc.target/bpf/core-builtin-exprlist-1.c index 8ce4a6e70de..c53daf81c5f 100644 --- a/gcc/testsuite/gcc.target/bpf/core-builtin-exprlist-1.c +++ b/gcc/testsuite/gcc.target/bpf/core-builtin-exprlist-1.c @@ -31,16 +31,16 @@ func (void) int ic; __builtin_preserve_access_index (({ - /* 1 */ + /* 0:1 */ b = my_s.b; - /* 2 */ + /* 0:2 */ ic = my_s.c; - /* 2:3 */ + /* 0:2:3 */ uc = my_u.uc[3]; - /* 6 */ + /* 0:6 */ ul = ula[6]; })); @@ -65,10 +65,10 @@ u_ptr (union U *pu) return x; } -/* { dg-final { scan-assembler-times "ascii \"1.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ -/* { dg-final { scan-assembler-times "ascii \"2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ -/* { dg-final { scan-assembler-times "ascii \"2:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ -/* { dg-final { scan-assembler-times "ascii \"6.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:1.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:2:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ +/* { dg-final { scan-assembler-times "ascii \"0:6.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ /* { dg-final { scan-assembler-times "ascii \"0:2:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */