public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Juzhe-Zhong <juzhe.zhong@rivai.ai>
To: gcc-patches@gcc.gnu.org
Cc: rguenther@suse.de, jeffreyalaw@gmail.com,
	Juzhe-Zhong <juzhe.zhong@rivai.ai>
Subject: [PATCH] test: Fix bb-slp-33.c for RVV
Date: Tue,  7 Nov 2023 16:47:25 +0800	[thread overview]
Message-ID: <20231107084725.178816-1-juzhe.zhong@rivai.ai> (raw)

As https://godbolt.org/z/hPsqahEa5 shows.
RVV failed dump check since "vectorizing stmts using SLP" shows 3 times instead of 2.

The root cause is this code in main:

  if (a[0] != 1
      || a[1] != 2
      || a[2] != 3
      || a[3] != 4
      || a[4] != 7
      || a[5] != 0
      || a[6] != 0
      || a[7] != 0
      || a[8] != 0)
    abort ();

is vectorized. So add -fno-tree-vectorize avoid the confusing check.

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/bb-slp-33.c: Add -fno-tree-vectorize to main.

---
 gcc/testsuite/gcc.dg/vect/bb-slp-33.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-33.c b/gcc/testsuite/gcc.dg/vect/bb-slp-33.c
index bbb13ef798e..f44cbdcfbcf 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-33.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-33.c
@@ -17,7 +17,8 @@ test(int *__restrict__ a, int *__restrict__ b)
   a[8] = 0;
 }
 
-int main()
+int __attribute__((optimize(("-fno-tree-vectorize"))))
+main()
 {
   int a[9];
   int b[4];
-- 
2.36.3


             reply	other threads:[~2023-11-07  8:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-07  8:47 Juzhe-Zhong [this message]
2023-11-07 13:48 ` Richard Biener
2023-11-07 15:19   ` 钟居哲

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=20231107084725.178816-1-juzhe.zhong@rivai.ai \
    --to=juzhe.zhong@rivai.ai \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=rguenther@suse.de \
    /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).