From: Jeff Law Date: Sat, 7 Feb 2026 18:49:30 +0000 (-0700) Subject: Fix testsuite scan failure on loongarch64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ad11691d3daab965fc34572e7683fe02b25e741;p=thirdparty%2Fgcc.git Fix testsuite scan failure on loongarch64 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. --- diff --git a/gcc/testsuite/gcc.dg/pr90838.c b/gcc/testsuite/gcc.dg/pr90838.c index 8b06929cfdd..bb3567e6e75 100644 --- a/gcc/testsuite/gcc.dg/pr90838.c +++ b/gcc/testsuite/gcc.dg/pr90838.c @@ -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*-*-* } } } } */