* [PATCH] loongarch: testsuite: adapt stack-usage-1.c for LP64
@ 2022-04-08 21:48 Xi Ruoyao
2022-04-09 6:29 ` Cheng Lulu
0 siblings, 1 reply; 2+ messages in thread
From: Xi Ruoyao @ 2022-04-08 21:48 UTC (permalink / raw)
To: gcc-patches; +Cc: Chenghua Xu, Lulu Cheng
Another simple testcase change for LoongArch. Ok for trunk?
---
LoongArch backend allocates two additional 8-byte stack slots for LP64,
one for saving $fp and another for saving the temporary value "1".
Ideally they are both unneeded, but (1) we're using -O0 so the code is
suboptimized by the nature; (2) any improvement (if possible) should be
deferred to GCC 13. So for now simply adjust the test to make it pass.
gcc/testsuite/
* gcc.dg/stack-usage-1.c: Adjust for LoongArch LP64.
---
gcc/testsuite/gcc.dg/stack-usage-1.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gcc/testsuite/gcc.dg/stack-usage-1.c b/gcc/testsuite/gcc.dg/stack-usage-1.c
index 1d7d1fee435..21cce0f440c 100644
--- a/gcc/testsuite/gcc.dg/stack-usage-1.c
+++ b/gcc/testsuite/gcc.dg/stack-usage-1.c
@@ -105,6 +105,8 @@
# define SIZE 252
#elif defined (__CRIS__)
# define SIZE 252
+#elif defined (__loongarch_lp64)
+# define SIZE 240 /* 256 - 8 bytes for $fp, and 8 bytes for a temp value */
#else
# define SIZE 256
#endif
--
2.35.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] loongarch: testsuite: adapt stack-usage-1.c for LP64
2022-04-08 21:48 [PATCH] loongarch: testsuite: adapt stack-usage-1.c for LP64 Xi Ruoyao
@ 2022-04-09 6:29 ` Cheng Lulu
0 siblings, 0 replies; 2+ messages in thread
From: Cheng Lulu @ 2022-04-09 6:29 UTC (permalink / raw)
To: Xi Ruoyao, gcc-patches; +Cc: Chenghua Xu
在 2022/4/9 上午5:48, Xi Ruoyao 写道:
> Another simple testcase change for LoongArch. Ok for trunk?
>
> ---
>
> LoongArch backend allocates two additional 8-byte stack slots for LP64,
> one for saving $fp and another for saving the temporary value "1".
> Ideally they are both unneeded, but (1) we're using -O0 so the code is
> suboptimized by the nature; (2) any improvement (if possible) should be
> deferred to GCC 13. So for now simply adjust the test to make it pass.
>
> gcc/testsuite/
>
> * gcc.dg/stack-usage-1.c: Adjust for LoongArch LP64.
> ---
> gcc/testsuite/gcc.dg/stack-usage-1.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/gcc/testsuite/gcc.dg/stack-usage-1.c b/gcc/testsuite/gcc.dg/stack-usage-1.c
> index 1d7d1fee435..21cce0f440c 100644
> --- a/gcc/testsuite/gcc.dg/stack-usage-1.c
> +++ b/gcc/testsuite/gcc.dg/stack-usage-1.c
> @@ -105,6 +105,8 @@
> # define SIZE 252
> #elif defined (__CRIS__)
> # define SIZE 252
> +#elif defined (__loongarch_lp64)
> +# define SIZE 240 /* 256 - 8 bytes for $fp, and 8 bytes for a temp value */
> #else
> # define SIZE 256
> #endif
OK.
Thanks!
Lulu Cheng
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-09 6:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 21:48 [PATCH] loongarch: testsuite: adapt stack-usage-1.c for LP64 Xi Ruoyao
2022-04-09 6:29 ` Cheng Lulu
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).