From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id E70423858CDB for ; Thu, 20 Jul 2023 12:34:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E70423858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 311E92F4; Thu, 20 Jul 2023 05:35:08 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 385853F6C4; Thu, 20 Jul 2023 05:34:24 -0700 (PDT) From: Richard Sandiford To: "Kewen.Lin" Mail-Followup-To: "Kewen.Lin" ,GCC Patches , Fangrui Song , Richard Biener , richard.sandiford@arm.com Cc: GCC Patches , Fangrui Song , Richard Biener Subject: Re: [PATCH] testsuite: Add a test case for PR110729 References: Date: Thu, 20 Jul 2023 13:34:23 +0100 In-Reply-To: (Kewen Lin's message of "Thu, 20 Jul 2023 18:13:25 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-26.3 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,KAM_NUMSUBJECT,KAM_SHORT,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 List-Id: "Kewen.Lin" writes: > 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. OK, thanks. Richard > --- > 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