From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by sourceware.org (Postfix) with ESMTPS id B0461385454D for ; Thu, 17 Nov 2022 23:59:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B0461385454D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dabbelt.com Received: by mail-pj1-x102a.google.com with SMTP id v4-20020a17090a088400b00212cb0ed97eso3504441pjc.5 for ; Thu, 17 Nov 2022 15:59:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=z7Bd/DprmcoOsCpGr+2ZS2mzMtZSgAd/5hXaqXDSurk=; b=MESzmzpP3YAJRFSK64/5ui6ShlCN3uIkuLoWMRuG0yJ7Hh0cGH7Exq1ztHeKJUB8VS kDs18Hr/NqLPifQLWTjK2Cly+b4y/hjxAL4L9RJ+fOWcZap31oewDoojg8kDMV2z2knZ 889RI5iTQIyVQ+ARrnUEiQ34VomDT2qqPHFVn/Sf0GrfSDLU8VCxqN4uZOgMom53yDLu MZget6s/lBrCbdVmTSGEy6h+mkPNJI+Wkzz85bAptoJnvlQ3tWBleORNFWMssxakrOhL D8ZWgnu0QequlZ7sEccviRoObEd12YbB4Qo/e7asaQAPd8y75FVgG1g3C+ngspl5OQXY bMiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=z7Bd/DprmcoOsCpGr+2ZS2mzMtZSgAd/5hXaqXDSurk=; b=CdLtskKX+qB8oYLFitefHTd6/qZg+wyvwnACCwdI3r7EGe+xIilV/x5Xv9yAIFT0tC xr1hXNPx7Z+iEQGCiticUWiF4CArQcVCjxP2EIEt81FEeJhEyn9i2KtcUv3GU6co7uYl iFSABn/kceiaB+DyCdRLN4HICLgnIZZN+7kUnmDGfBakTbQwkfo/Jf8LUx932LO3BKKs O4JSIdyfCcywHHQsQNbzEtL2HUhU05Ru7t7z4MqpP5PcGuX8ioRmm+ecQF2LiCx8Z6H6 yPFrD5x6DYXQml5RBCkp+ygnmmpe2IhqceaB3hB/YFWDkbqmkyu9R7bZ7J7+r+mJuahp fq5A== X-Gm-Message-State: ANoB5pkcERfepvrcDSEFfwgnzlppO9RJ4jfZgUgI6tfSGH+r9gAZg7ya 4yjbk6+vQw66l56WbobPVOygPluAM5drgA== X-Google-Smtp-Source: AA0mqf4f4oVbYR6n/F1A0JJI4nDAck5Hp3AJuve3dQsF6dSbIQyPb676oQAfdKMv54X3c/lHVe2b1w== X-Received: by 2002:a17:90a:1a12:b0:20a:6ffc:f0c6 with SMTP id 18-20020a17090a1a1200b0020a6ffcf0c6mr11222402pjk.49.1668729590474; Thu, 17 Nov 2022 15:59:50 -0800 (PST) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id ju13-20020a170903428d00b001869f2120a4sm2003664plb.94.2022.11.17.15.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 15:59:48 -0800 (PST) Date: Thu, 17 Nov 2022 15:59:48 -0800 (PST) X-Google-Original-Date: Thu, 17 Nov 2022 15:59:43 PST (-0800) Subject: Re: [PATCH] Ver.2: Add compile option "-msmall-data-limit=0" to avoid using .srodata section for riscv. In-Reply-To: <36c502d5-a556-ab12-5466-32c112a2242f@gmail.com> CC: chenyixuan@iscas.ac.cn, gcc-patches@gcc.gnu.org, Kito Cheng , Andrew Waterman , oriachiuan@gmail.com From: Palmer Dabbelt To: gcc-patches@gcc.gnu.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: On Thu, 17 Nov 2022 13:50:00 PST (-0800), gcc-patches@gcc.gnu.org wrote: > > On 11/17/22 02:53, Yixuan Chen wrote: >> 2022-11-17 Yixuan Chen >> >> * gcc/testsuite/gcc.dg/pr25521.c: Add compile option "-msmall-data-limit=0" to avoid using .srodata section for riscv. >> --- >> gcc/testsuite/gcc.dg/pr25521.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/gcc/testsuite/gcc.dg/pr25521.c b/gcc/testsuite/gcc.dg/pr25521.c >> index 74fe2ae6626..628ddf1a761 100644 >> --- a/gcc/testsuite/gcc.dg/pr25521.c >> +++ b/gcc/testsuite/gcc.dg/pr25521.c >> @@ -2,7 +2,8 @@ >> sections. >> >> { dg-require-effective-target elf } >> - { dg-do compile } */ >> + { dg-do compile } >> + { dg-options "-msmall-data-limit=0" { target { riscv*-*-* } } } */ >> >> const volatile int foo = 30; >> > > Wouldn't this be better?  It avoids a target specific conditional by > instead extending what we look for to cover [s]rodata sections. > > > Thoughts? > > Jeff > diff --git a/gcc/testsuite/gcc.dg/pr25521.c b/gcc/testsuite/gcc.dg/pr25521.c > index 74fe2ae6626..63363a03b9f 100644 > --- a/gcc/testsuite/gcc.dg/pr25521.c > +++ b/gcc/testsuite/gcc.dg/pr25521.c > @@ -7,4 +7,4 @@ > const volatile int foo = 30; > > > -/* { dg-final { scan-assembler "\\.rodata" } } */ > +/* { dg-final { scan-assembler "\\.s\?rodata" } } */ That's how I usually do it for these tests, there's some other targets with sdata too so it fixes the test for everyone. IIRC I said something like that in the v1, but sorry if I'm just getting it confused with some other patch. There's a few of these that need to get chased down for every release, maybe we should add some sort of DG hepler? Not sure that'd keep folks from matching on .data, though...