public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Andrew Pinski <pinskia@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-9016] aarch64: Fix undefined code in vect_ctz_1.c
Date: Thu, 15 Feb 2024 18:31:26 +0000 (GMT)	[thread overview]
Message-ID: <20240215183126.8E2573865C22@sourceware.org> (raw)

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

commit r14-9016-gcb80582229e7800eeb9570c24186b843dff5fcd7
Author: Andrew Pinski <quic_apinski@quicinc.com>
Date:   Fri Feb 2 13:13:58 2024 -0800

    aarch64: Fix undefined code in vect_ctz_1.c
    
    The testcase gcc.target/aarch64/vect_ctz_1.c fails execution when running
    with -march=armv9-a due to the testcase calls __builtin_ctz with a value of 0.
    The testcase should not depend on undefined behavior of __builtin_ctz. So this
    changes it to use the g form with the 2nd argument of 32. Now the execution part
    of the testcase work. It still has a scan-assembler failure which should be fixed
    seperately.
    
    Tested on aarch64-linux-gnu.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/aarch64/vect_ctz_1.c (TEST): Use g form of the builtin and pass 32
            as the value expected at 0.
    
    Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>

Diff:
---
 gcc/testsuite/gcc.target/aarch64/vect_ctz_1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.target/aarch64/vect_ctz_1.c b/gcc/testsuite/gcc.target/aarch64/vect_ctz_1.c
index c4eaf5b3a91d..5fcf1e31ab2c 100644
--- a/gcc/testsuite/gcc.target/aarch64/vect_ctz_1.c
+++ b/gcc/testsuite/gcc.target/aarch64/vect_ctz_1.c
@@ -9,7 +9,7 @@ count_tz_##name (unsigned *__restrict a, int *__restrict b) \
 { \
   int i; \
   for (i = 0; i < count; i++) \
-    b[i] = __builtin_##subname (a[i]); \
+    b[i] = __builtin_##subname##g (a[i], 32); \
 }
 
 #define CHECK(name, count, input, output) \

                 reply	other threads:[~2024-02-15 18:31 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=20240215183126.8E2573865C22@sourceware.org \
    --to=pinskia@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).