From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 4F4573858CDB for ; Thu, 20 Jul 2023 10:13:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4F4573858CDB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36K9d8jf001748; Thu, 20 Jul 2023 10:13:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : to : cc : from : subject : content-type : content-transfer-encoding : mime-version; s=pp1; bh=WBW1eOM1q8Ohnp8uIgILqJYr57ZUN7ze/QB1cvvu1r0=; b=Bl1aM5bZCp3RCeZ05uL7EhmG8DogZRyB1C9pnR+S/82iRq+G4mnDR4884z69NjjMwSGB ezh0EXzQ2oCSx2kqRZBADYGdIZkTarlWsTNIeO1gXOnijTIuWysyzq+AZxUgiygNhs99 ybbeSIZghpJeB+z0uyUvp9SDELy8Q4rV6uxqel/G1lUBthJK4ih9gdPBabCr4c7UiaY9 HzL1BXDdOJaOV3WtnZ4yoAn/xoMaQx5lfg5udJN8HCtexUoYx55vloR9kcvhpWLIhhL0 d3//cCL/Ciu+E5piEilDSnA5RdrLIqObg9C/fltcCiaMo5NQRfwPz1FI1WQswDt7v0eQ jA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ry018491b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 20 Jul 2023 10:13:42 +0000 Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 36KA8W5i011708; Thu, 20 Jul 2023 10:13:42 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ry018490v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 20 Jul 2023 10:13:41 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 36K9t5kf003352; Thu, 20 Jul 2023 10:13:41 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3rv65xp49s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 20 Jul 2023 10:13:41 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 36KADdAH41091628 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 20 Jul 2023 10:13:39 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3DFA920043; Thu, 20 Jul 2023 10:13:39 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8558120040; Thu, 20 Jul 2023 10:13:37 +0000 (GMT) Received: from [9.177.28.8] (unknown [9.177.28.8]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 20 Jul 2023 10:13:37 +0000 (GMT) Message-ID: Date: Thu, 20 Jul 2023 18:13:25 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Content-Language: en-US To: GCC Patches Cc: Fangrui Song , Richard Biener , Richard Sandiford From: "Kewen.Lin" Subject: [PATCH] testsuite: Add a test case for PR110729 Content-Type: text/plain; charset=UTF-8 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 9DNP6HtBYfVKPCQqkMdLiFjdZdird9aW X-Proofpoint-ORIG-GUID: -KQUY1EpmLyfbItcmLwrynLz679rYwBP Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-20_04,2023-07-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 suspectscore=0 adultscore=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 phishscore=0 mlxlogscore=999 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307200084 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,KAM_SHORT,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,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 List-Id: Hi, As PR110729 reported, there was one issue for .section __patchable_function_entries with -ffunction-sections, that is we put the same symbol as link_to section symbol for all functions wrongly. The commit r13-4294 for PR99889 has fixed this with the corresponding label LPFE* which sits in the function_section. As Fangrui suggested[1], this patch is to add a bit more test coverage. I didn't find a good way to check all linked_to symbols are different, so I checked for LPFE[012] here. [1] https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624866.html Tested well on x86_64-redhat-linux, powerpc64-linux-gnu P7/P8/P9 and powerpc64le-linux-gnu P9/P10. Is it ok for trunk? BR, Kewen ----- PR testsuite/110729 gcc/testsuite/ChangeLog: * gcc.dg/pr110729.c: New test. --- gcc/testsuite/gcc.dg/pr110729.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr110729.c diff --git a/gcc/testsuite/gcc.dg/pr110729.c b/gcc/testsuite/gcc.dg/pr110729.c new file mode 100644 index 00000000000..92dfd8ae000 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr110729.c @@ -0,0 +1,29 @@ +/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */ +/* { dg-require-effective-target o_flag_in_section } */ +/* { dg-options "-ffunction-sections -fpatchable-function-entry=2" } */ +/* { dg-additional-options "-fno-pie" { target sparc*-*-* } } */ + +/* Verify there are three different link_to symbols for three + .section __patchable_function_entries respectively. */ + +int +f () +{ + return 1; +} + +int +g () +{ + return 2; +} + +int +h () +{ + return 3; +} + +/* { dg-final { scan-assembler-times {.section[\t ]*__patchable_function_entries,.*,\.LPFE0} 1 } } */ +/* { dg-final { scan-assembler-times {.section[\t ]*__patchable_function_entries,.*,\.LPFE1} 1 } } */ +/* { dg-final { scan-assembler-times {.section[\t ]*__patchable_function_entries,.*,\.LPFE2} 1 } } */ -- 2.39.3