From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe2e.google.com (mail-vs1-xe2e.google.com [IPv6:2607:f8b0:4864:20::e2e]) by sourceware.org (Postfix) with ESMTPS id 0CD013853D68 for ; Fri, 18 Nov 2022 03:30:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0CD013853D68 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vs1-xe2e.google.com with SMTP id k67so3568850vsk.2 for ; Thu, 17 Nov 2022 19:30:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2Td23tC8sJjyK9RlYE8ylWynZpr7TfrhZ2hewN575r0=; b=Iz4G8GfVDS31X4eL8zVHPoPtnlj/Py8xuYya038iQYzJja9RQtBtJApiAaTp+oPxc4 cXdvUotORuT+AtJYPCc+f2ZZ58kvlzLlCcmdf102loOx9xYTzUxjz5jxizJm+p8SIz6+ upV8aiq5uagkBNblhaSYMVsTVhFpLIOekuTNknP/+H9UPm2kptL0aacobAmi1IAQblPb gd8C4Wf2LR5m0HbhBxkykKYmvyrLVCJB7ivmDak2LGdxGLnJKMQuIPPF+BWd1qGaNRDk d9eRA3qoa7q14MZ8XKLHKpndgBwMia/4g2Bfe9x/FLrN7EJktcGHqx7VS28BWRbhuRmZ n/XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2Td23tC8sJjyK9RlYE8ylWynZpr7TfrhZ2hewN575r0=; b=3CrxZuCKCooUzw0edkGYA2zu0P+XED53eydQh5XHH68OTvZ3SlnlNrysvucYmJEuTY dKYzYQjEwrcu+6RRnM1zoWYCpga9x/ZY7Vg+CiVU0eyXTwuD9udHZ8jV5Bdmc4oHLPsg KmSf0ATlLnQh4WncrZ7QpcBxDSolRLnNTvG2cJ3Q66xWR5E2nYPjCzt5e+dyxS+TApXL iAuY0o3aeBQ5LR2dKZGKVPkPLe8KkFQGg932s4luUfQvHGkq3xSZiQNJQ/FzcLwmxphj /QZVnypqpPICmDHGe93Nm02PjE2pLKvzEZV79OqgS58aYmc0a6O/Pyk+Edk/mmH5u0o6 9xkw== X-Gm-Message-State: ANoB5pnZ7hbLYofrBR0lk+MFdoQTpncsn0fELrTEBXvexofcEexmAbU8 yMGxT5vHGMZQdcDuFtrxAOsqEb5AUXVmm00ZIow= X-Google-Smtp-Source: AA0mqf4aMLVC2Mytj0U+FOCJ1/yS6n/lsXN+2FN/yMhj+K0Y1thkQVuA2DYf7nX+1dnISubmK9/tsd6XNX/OlVVnnDY= X-Received: by 2002:a05:6102:11f1:b0:3aa:26a8:3fe8 with SMTP id e17-20020a05610211f100b003aa26a83fe8mr3449698vsg.13.1668742234342; Thu, 17 Nov 2022 19:30:34 -0800 (PST) MIME-Version: 1.0 References: <36c502d5-a556-ab12-5466-32c112a2242f@gmail.com> In-Reply-To: From: Oria Chiuan Date: Fri, 18 Nov 2022 11:30:23 +0800 Message-ID: Subject: Re: [PATCH] Ver.2: Add compile option "-msmall-data-limit=0" to avoid using .srodata section for riscv. To: Palmer Dabbelt Cc: gcc-patches@gcc.gnu.org, chenyixuan@iscas.ac.cn, Kito Cheng , Andrew Waterman , jiawei@iscas.ac.cn Content-Type: multipart/alternative; boundary="000000000000198a0805edb65429" X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,HTML_MESSAGE,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: --000000000000198a0805edb65429 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Got it, I used to regard this test case as targeting at test if the const data would use the ".rodata" section. Palmer Dabbelt =E4=BA=8E2022=E5=B9=B411=E6=9C=8818=E6= =97=A5=E5=91=A8=E4=BA=94 07:59=E5=86=99=E9=81=93=EF=BC=9A > 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=3D0" 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=3D0" { target { riscv*-*-* } } } = */ > >> > >> const volatile int foo =3D 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 =3D 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... > --000000000000198a0805edb65429--