]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix testsuite scan failure on loongarch64
authorJeff Law <jeffrey.law@oss.qualcomm.com>
Sat, 7 Feb 2026 18:49:30 +0000 (11:49 -0700)
committerJeff Law <jeffrey.law@oss.qualcomm.com>
Sat, 7 Feb 2026 18:50:43 +0000 (11:50 -0700)
Robin's patch to fix nonzero bits for the result of a popcount triggered a
minor testsuite scan failure for loongarch.  Essentially it was expecting to
see an ANDI for a zero-extend, but after the change we get a slli with a count
0, which is used for sign extension on loongarch.

Both are likely equally performant.  So this just adjusts the test to accept
both forms.  Now one could argue that the result of the popcount is already
sign extended and you'd be right -- that's a separate missed optimization issue
and unrelated to this testsuite regression.

Anyway, pushing this to the trunk.

gcc/testsuite/
* gcc.dg/pr90838.c: Adjust expected output for loongarch.

gcc/testsuite/gcc.dg/pr90838.c

index 8b06929cfddac972e85b8869ccd1abe450b326f4..bb3567e6e750d5ff10bac0fa48edfdf05e5f8c2c 100644 (file)
@@ -3,7 +3,7 @@
 /* { dg-additional-options "-mbmi" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } */
 /* { dg-additional-options "-march=rv64gc_zbb" { target { rv64 } } } */
 /* { dg-additional-options "-march=rv32gc_zbb" { target { rv32 } } } */
-/* { dg-require-effective-target int32plus } */
+/* { g-require-effective-target int32plus } */
 
 int ctz1 (unsigned x)
 {
@@ -87,4 +87,4 @@ int ctz4 (unsigned long x)
 /* { dg-final { scan-tree-dump-times {= \.CTZ} 4 "forwprop2" { target { loongarch64*-*-* } } } } */
 /* { dg-final { scan-assembler-times "ctz.d\t" 1 { target { loongarch64*-*-* } } } } */
 /* { dg-final { scan-assembler-times "ctz.w\t" 3 { target { loongarch64*-*-* } } } } */
-/* { dg-final { scan-assembler-times "andi\t" 4 { target { loongarch64*-*-* } } } } */
+/* { dg-final { scan-assembler-times "\(andi|slli.w\)\t" 4 { target { loongarch64*-*-* } } } } */