public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] fix small const data for riscv
@ 2022-11-11 13:02 Oria Chen
  2022-11-11 19:56 ` Andrew Pinski
  0 siblings, 1 reply; 3+ messages in thread
From: Oria Chen @ 2022-11-11 13:02 UTC (permalink / raw)
  To: gcc-patches; +Cc: kito.cheng, andrew, Oria Chen

gcc/testsuite ChangeLog:

2022-11-11  Oria Chen  <oriachiuan@gmail.com>

        * gcc/testsuite/gcc.dg/pr25521.c: Add compile option "-msmall-data-limit=0" to avoid using .srodata section.  
---
 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;
 
-- 
2.37.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix small const data for riscv
  2022-11-11 13:02 [PATCH] fix small const data for riscv Oria Chen
@ 2022-11-11 19:56 ` Andrew Pinski
  2022-11-11 20:34   ` Palmer Dabbelt
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Pinski @ 2022-11-11 19:56 UTC (permalink / raw)
  To: Oria Chen; +Cc: gcc-patches, kito.cheng, andrew

On Fri, Nov 11, 2022 at 5:03 AM Oria Chen via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> gcc/testsuite ChangeLog:
>
> 2022-11-11  Oria Chen  <oriachiuan@gmail.com>
>
>         * gcc/testsuite/gcc.dg/pr25521.c: Add compile option "-msmall-data-limit=0" to avoid using .srodata section.

I noticed g++.dg/cpp0x/constexpr-rom.C has some slightly different
handling here.
Seems like there should be a generic way to add
-G0/-msmall-data-limit=0 if we don't want small data for a testcase
rather than the current scheme of things.

Thanks,
Andrew Pinski

> ---
>  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;
>
> --
> 2.37.2
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix small const data for riscv
  2022-11-11 19:56 ` Andrew Pinski
@ 2022-11-11 20:34   ` Palmer Dabbelt
  0 siblings, 0 replies; 3+ messages in thread
From: Palmer Dabbelt @ 2022-11-11 20:34 UTC (permalink / raw)
  To: gcc-patches; +Cc: oriachiuan, gcc-patches, Kito Cheng, Andrew Waterman

On Fri, 11 Nov 2022 11:56:08 PST (-0800), gcc-patches@gcc.gnu.org wrote:
> On Fri, Nov 11, 2022 at 5:03 AM Oria Chen via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
>>
>> gcc/testsuite ChangeLog:
>>
>> 2022-11-11  Oria Chen  <oriachiuan@gmail.com>
>>
>>         * gcc/testsuite/gcc.dg/pr25521.c: Add compile option "-msmall-data-limit=0" to avoid using .srodata section.
>
> I noticed g++.dg/cpp0x/constexpr-rom.C has some slightly different
> handling here.
> Seems like there should be a generic way to add
> -G0/-msmall-data-limit=0 if we don't want small data for a testcase
> rather than the current scheme of things.

There's also a few tests like these where we modified the regex to match 
.sadata in addition to .data, which fixes the problem on MIPS too.

>
> Thanks,
> Andrew Pinski
>
>> ---
>>  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;
>>
>> --
>> 2.37.2
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-11 20:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-11 13:02 [PATCH] fix small const data for riscv Oria Chen
2022-11-11 19:56 ` Andrew Pinski
2022-11-11 20:34   ` Palmer Dabbelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).