diff mbox series

loongarch: testsuite: adapt stack-usage-1.c for LP64

Message ID 016a28a2d5787915c2ca25c808c20ac36f41beda.camel@mengyan1223.wang
State New
Headers show
Series loongarch: testsuite: adapt stack-usage-1.c for LP64 | expand

Commit Message

Xi Ruoyao April 8, 2022, 9:48 p.m. UTC
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(+)

Comments

Lulu Cheng April 9, 2022, 6:29 a.m. UTC | #1
在 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
diff mbox series

Patch

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