From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 48CAD383B2A4 for ; Wed, 10 Apr 2024 19:20:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 48CAD383B2A4 Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 48CAD383B2A4 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1712776815; cv=pass; b=HwXEUPrLB/I0ipOG+pUlFRvaC/9wGcQ7XKnaL33qsFZ6/sN16e/RnvA7Qcavph11gImJhyU5y/TgMNOv2Uz6C6GCqCzDXKxPO9H8a3r6Qkcr8SbUj//ZvZ5iFsFiSZv+Yf/kacsNzIn26MkRcbRY+Dm0GXicT2uJp4DgLTsow+s= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1712776815; c=relaxed/simple; bh=CgnyipsDNGYotgb/pWthqq8oyEcOIQl+dKDjOBdK43M=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=mHjzYY948FRxVavGthbIJZuAlXwR+3zO1avBAKwN122cQ+x+DQ6uw4lg08QblfnBZfsaavTdhnctLcTNJjS4YUFL7ZePhNaY6HgMAbiZYB5G2nFV9s9M43s5cCM2Z5LQq/qLSUjMkpY8To+UWwa9cCwYlVJq3iOJfp9O41woo2s= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rudUH-0000Hx-Gf for gcc-patches@gcc.gnu.org; Wed, 10 Apr 2024 15:20:03 -0400 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43AIlmDU002360 for ; Wed, 10 Apr 2024 19:18:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : references : from : cc : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-11-20; bh=sdyBttdNXDf9HhExgSDdCGFacabY1tWxVzv1weN/2Nc=; b=aANtc3CXs13OZ/YTWXCCziFWCXt7xUz9hVZ9/thuUtJPRwGnttVc6ArF4ePF4q9sEfux RtMsDb2QLEZPMFG+YoBotWJnbS4IczjcfoA6cl6+H/aIDQQF6f2xjcZ7UXhuwGm/Npmq TqdxEmLfWuQRyCle3EhqQnL6gK41jcXEdhIwhlV0RbasWK9BoYCmEJhATTgSM0G26xLO Bh5ZkbOskuD7Cm/FyTewIVgeLj0N2jCifbhiZwGd5RHbjsAY5uQp3cfqt09WbllQ1R1+ ip6bqrApCTvDpYo5gdGC4eVoGzCU7Nlf92zRX7+jccFY5DBBD4b452dJZ8K8eRSriH8O yA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xaxedr85t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 10 Apr 2024 19:18:58 +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 43AHbSIc010627 for ; Wed, 10 Apr 2024 19:18:57 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2168.outbound.protection.outlook.com [104.47.55.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xavu8kwu0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 10 Apr 2024 19:18:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WFnAcyWs5LcyrfKR40QAGVJ49HQO+/Syi1uvyu/jd6qReqLFVyT+/lOQYacRxpsQ3OsO7wzXqd/HM9wkk4AWWfi5Nd7nhTuGdUmX4qdhAIDyBlO2H6VdEhW47LIzKTcnlBmULDspEtDNmoN9ENY9NMRDgKSrID9kkSD61djf5HR/dB4araO/ms0Jj+q2aI0HV5LM0q9Whe0TcXUlSLSO16v/la90Ktx74lKNlAQ7e2xQo1JN5xoGx5i8+Sh40ccBNEmQ835/Prz9/Ahtep4VHmDfFBJ4K0kphtlHF4LyCJC9uMSr4LgZ9y1UjJ3WYiPV2PpM1re+sjwF0lBaC8haBA== 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=sdyBttdNXDf9HhExgSDdCGFacabY1tWxVzv1weN/2Nc=; b=eIka8z8wl2cQceb5vsIlYoIbJQNGgL/V4mo3vIqlba4KBuDVyT7Sm3bZkg2Qx8f5+JIc0PfJxiCQb1R9AqtwI6k38/BpirXCiE+jDZfJ7JSyJ7zrUBLblzw9Ps08tA1FqBUXW8wGuExEaGIqlz3QWKtceDkuG66lxnOfbEUJ/bgmjOx6NvrxV6QMCBouaOpRIErU2J3fjQVPChBAC3iJfSuZgshT6azfKhPWvd9/WmQE4rBVlnn4r6R3f4ZsrJTECrOcxxtHoTrVDPoy2eb5Y3UBVeUWzU6k8w4geuu8TUSpySaZWMIfBEsln0tHecDNmUGUhKAAoUc2WTb4+dZkMg== 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=sdyBttdNXDf9HhExgSDdCGFacabY1tWxVzv1weN/2Nc=; b=0LEVw9TqxsECW6QBr+Pdmi7UbMYGyrJqR47oQxHQx6Ya+morbcbsM0RYKUwWhRwPVCU3fd5loIHGFu8O0G6v/BWKFSd+A52Y5N02BM/fGh2xdHAFyHeV61INnqkEbuAYFFvkEJxIe5kQa/+CL0oVhG4a95J76Mvoj2G4EqbtYm8= Received: from DS0PR10MB7953.namprd10.prod.outlook.com (2603:10b6:8:1a1::22) by SN4PR10MB5575.namprd10.prod.outlook.com (2603:10b6:806:206::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Wed, 10 Apr 2024 19:18:55 +0000 Received: from DS0PR10MB7953.namprd10.prod.outlook.com ([fe80::ddec:934d:1117:499d]) by DS0PR10MB7953.namprd10.prod.outlook.com ([fe80::ddec:934d:1117:499d%3]) with mapi id 15.20.7409.042; Wed, 10 Apr 2024 19:18:54 +0000 Message-ID: Date: Wed, 10 Apr 2024 12:18:53 -0700 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] btf: do not skip members of data type with type id BTF_VOID_TYPEID To: Indu Bhagat References: <20240410182511.1528093-1-indu.bhagat@oracle.com> <20240410182511.1528093-3-indu.bhagat@oracle.com> From: David Faust Content-Language: en-US Cc: gcc-patches@gcc.gnu.org In-Reply-To: <20240410182511.1528093-3-indu.bhagat@oracle.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR08CA0038.namprd08.prod.outlook.com (2603:10b6:a03:117::15) To DS0PR10MB7953.namprd10.prod.outlook.com (2603:10b6:8:1a1::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7953:EE_|SN4PR10MB5575:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yYhItqpyCGGHFUht03IMTMxYvE3heU4AMt73z1AzgYOlMZ/MvWLOvx3KhSz3c9KXeDyI0a7ShCIsIgdP2iQsPlTsMo2bTsuh/Bz2DJt/G/tv3nQlVFwM+HzBqgzgAzKvUtABpMu2QNeHHsj20zQ/LaOuO2/j9KXH4BCpBaBN4ESyMv2qUWm+wqUXjES+U/KRT3Y7dGqutUiZk2gcN0qZr+vWCQk69WRxIVBS/LOff2pzj8WCWigTISO1yeWyt5Tci/pjv+LSZSRE6NPHNRe/KR0B8WiPKWNduBOVXo4T7k5BEoUQV3+8VbOVnbSndutiVoYvG2cANW4sTbt6U/0zpsbhpKFl/PUCMyUFVdaAN4Z/UXdlkE8aqaaJIIWQi5W3Cncp9RpXX20Y3lLD40t4o1CFBQLwtzcdXynrBd/ge/WsUYwJTnx/SevikEXwulk1kIpbIxKVcryi62oHX4ZLhAoBH53UxwJWSZPvaY/p8H5TYcbjhmh5H1ONHW3DVrmDnJcPJDUQtEmjSMWzN+BT2dvM4F9fwuVpEt+8P9LdMdpV8QPIHy99+Ljcf5DxRGl6Vcgu+DJizkygEKk482mJQjgIsVKwWRsyg1OXabjvG0XyWy70ZSX2VLOvRdyJvga56Im+lKdUoq7Q4ms7yDEqDXTw0o3PlgJkJ2twHb7/YLc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR10MB7953.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(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M1NO02SW8q+4ITSmcqhwWMHwAAysdPQvv67jqmdYRVnnHeCsqNKabsKEx8UMtdmEBgOROfq/usOYqd2+RMctm82gPoZhcoAoYxN+efq5IHra/d2fIX3m0ybZUjvB5DklfXz5XlbsB4F2dGnDJZKgwBp1LvPI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e820d47a-b1e3-4b6f-11bf-08dc59931040 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7953.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2024 19:18:54.9205 (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: nHxGlSLF6iKF8YYH5ePJd07Sv4j5EUXDYUlNfY0sR0EvdGNqSiEzn9F0tm+ZEKl083nUfbhWTYqLMC0RbBAnFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5575 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-10_04,2024-04-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 suspectscore=0 spamscore=0 mlxscore=0 bulkscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404100142 X-Proofpoint-GUID: QPHMXYpfcsV8xnM_8O3kfqf_4iNNombK X-Proofpoint-ORIG-GUID: QPHMXYpfcsV8xnM_8O3kfqf_4iNNombK Received-SPF: pass client-ip=205.220.177.32; envelope-from=david.faust@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DKIM_VALID_EF=-0.1,RCVD_IN_DNSWL_LOW=-0.7,RCVD_IN_MSPIKE_H4=0.001,RCVD_IN_MSPIKE_WL=0.001,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,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 List-Id: Hi Indu, On 4/10/24 11:25, Indu Bhagat wrote: > Testing the previous fix in gen_ctf_sou_type () reveals an issue in BTF > generation, however: BTF emission was currently decrementing the vlen > (indicating the number of members) to skip members of type CTF_K_UNKNOWN > altogether, but still emitting the BTF for the corresponding member (in > output_asm_btf_sou_fields ()). > > One can see malformed BTF by executing the newly added CTF testcase > (gcc.dg/debug/ctf/ctf-bitfields-5.c) with -gbtf instead or even existing > btf-struct-2.c without this patch. > > To fix the issue, it makes sense to rather _not_ skip members of data > type of type id BTF_VOID_TYPEID. Thank you for catching and fixing this. FWIW, what to do in such cases for a struct with a member that has no representation is undefined behavior in BTF. I certainly agree it's better not to emit something malformed, and using 'void' is a good choice. Better to know there was a member there that could not be represented than to skip it altogether, and the total struct size shall still be correct. OK. Thanks! > > gcc/ChangeLog: > * btfout.cc (btf_asm_type): Do not skip emitting members of > unknown type. > > gcc/testsuite/ChangeLog: > * btf-bitfields-4.c: Update the vlen check. > * btf-struct-2.c: Check that member named 'f' with void data > type is emitted. > --- > gcc/btfout.cc | 5 ----- > gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-4.c | 6 +++--- > gcc/testsuite/gcc.dg/debug/btf/btf-struct-2.c | 9 +++++---- > 3 files changed, 8 insertions(+), 12 deletions(-) > > diff --git a/gcc/btfout.cc b/gcc/btfout.cc > index 4a8ec4d1ff0..ab491f0297f 100644 > --- a/gcc/btfout.cc > +++ b/gcc/btfout.cc > @@ -820,11 +820,6 @@ btf_asm_type (ctf_container_ref ctfc, ctf_dtdef_ref dtd) > /* Set kflag if this member is a representable bitfield. */ > if (btf_dmd_representable_bitfield_p (ctfc, dmd)) > btf_kflag = 1; > - > - /* Struct members that refer to unsupported types or bitfield formats > - shall be skipped. These are marked during preprocessing. */ > - else if (!btf_emit_id_p (dmd->dmd_type)) > - btf_vlen -= 1; > } > } > > diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-4.c b/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-4.c > index c00c8b3d87f..d4a6ef6a1eb 100644 > --- a/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-4.c > +++ b/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-4.c > @@ -6,14 +6,14 @@ > In this test, we construct a structure such that the bitfield will have > an offset so large as to be unrepresentable in BTF. We expect that the > resulting BTF will describe the rest of the structure, ignoring the > - non-representable bitfield. */ > + non-representable bitfield by simply using void data type for the same. */ > > /* { dg-do compile } */ > /* { dg-options "-O0 -gbtf -dA" } */ > /* { dg-require-effective-target size32plus } */ > > -/* Struct with 3 members and no bitfield (kind_flag not set). */ > -/* { dg-final { scan-assembler-times "\[\t \]0x4000003\[\t \]+\[^\n\]*btt_info" 1 } } */ > +/* Struct with 4 members and no bitfield (kind_flag not set). */ > +/* { dg-final { scan-assembler-times "\[\t \]0x4000004\[\t \]+\[^\n\]*btt_info" 1 } } */ > > struct bigly > { > diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-struct-2.c b/gcc/testsuite/gcc.dg/debug/btf/btf-struct-2.c > index e9ff06883db..fa7231be75c 100644 > --- a/gcc/testsuite/gcc.dg/debug/btf/btf-struct-2.c > +++ b/gcc/testsuite/gcc.dg/debug/btf/btf-struct-2.c > @@ -2,14 +2,15 @@ > unsupported type. > > BTF does not support vector types (among other things). When > - generating BTF for a struct (or union) type, members which refer to > - unsupported types should be skipped. */ > + generating BTF for a struct (or union) type. Members which refer to > + unsupported types should not be skipped, however. */ > > /* { dg-do compile } */ > /* { dg-options "-O0 -gbtf -dA" } */ > > -/* Expect a struct with only 2 members - 'f' should not be present. */ > -/* { dg-final { scan-assembler-times "\[\t \]0x4000002\[\t \]+\[^\n\]*btt_info" 1 } } */ > +/* Expect a struct with 3 members - 'f' is present but is of data type void. */ > +/* { dg-final { scan-assembler-times "\[\t \]0x4000003\[\t \]+\[^\n\]*btt_info" 1 } } */ > +/* { dg-final { scan-assembler-times " MEMBER 'f' idx=1\[\\r\\n\]+\[^\\r\\n\]*0\[\t \]+\[^\n\]*btm_type: void" 1 } } */ > > struct with_float > {