public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-8068] loongarch: testsuite: adapt stack-usage-1.c for LP64
Date: Sat,  9 Apr 2022 11:43:16 +0000 (GMT)	[thread overview]
Message-ID: <20220409114316.2BA443857C50@sourceware.org> (raw)

https://gcc.gnu.org/g:c8f7324e81c1bb7093a5b44317af385e5774f9a3

commit r12-8068-gc8f7324e81c1bb7093a5b44317af385e5774f9a3
Author: Xi Ruoyao <xry111@mengyan1223.wang>
Date:   Sat Apr 9 01:58:40 2022 +0800

    loongarch: testsuite: adapt stack-usage-1.c for LP64
    
    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.

Diff:
---
 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


                 reply	other threads:[~2022-04-09 11:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220409114316.2BA443857C50@sourceware.org \
    --to=xry111@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).