]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix signed char test assumption [Was Re: [Linaro-TCWG-CI] gcc-17-2261-g649b2a6d9f9f...
authorJeff Law <jeffrey.law@oss.qualcomm.com>
Fri, 17 Jul 2026 13:14:13 +0000 (07:14 -0600)
committerJeff Law <jeffrey.law@oss.qualcomm.com>
Fri, 17 Jul 2026 13:16:16 +0000 (07:16 -0600)
> Dear contributor,
>
> Our automatic CI has detected problems related to your patch(es). Please find some details below.
>
> In  armv8l-unknown-linux-gnueabihf native, after:
>   | commit gcc-17-2261-g649b2a6d9f9f
>   | Author: Jeff Law <jeffrey.law@oss.qualcomm.com>
>   | Date:   Wed Jul 8 12:30:56 2026 -0600
>   |
>   |     [PR rtl-optimization/126136] Fix dest = cond ? x : -1 when STORE_FLAG_VALUE is -1
>   |
>   |     So a while back I added support for selecting x/-1 into the ifcvt.cc by using
>   |     scc and a couple ALU operations.  That code explicitly rejects STORE_FLAG_VALUE
>   |     if it is not 1 or -1.
>   | ... 20 lines of the commit log omitted.
>
> Produces 7 regressions:
>   |
>   | regressions.sum:
>   | Running gcc:gcc.dg/torture/dg-torture.exp ...
>   | FAIL: gcc.dg/torture/pr126136.c -O0  execution test
>   | FAIL: gcc.dg/torture/pr126136.c -O1  execution test
>   | FAIL: gcc.dg/torture/pr126136.c -O2  execution test
>   | FAIL: gcc.dg/torture/pr126136.c -O2 -flto -fno-use-linker-plugin -flto-partition=none  execution test
>   | ... and 3 more
>
> Used configuration :
>  *CI config* tcwg_gcc_check armv8l-unknown-linux-gnueabihf
>  *configure and test flags:* none, autodetected on armv8l-unknown-linux-gnueabihf--disable-multilib --with-float=hard --with-mode=thumb --with-tune=cortex-a9 --with-arch=armv7-a --with-fpu=neon-fp-armv8
>
> We track this bug report under https://linaro.atlassian.net/browse/GNU-1959. (Require Linaro login) Please let us know if you have a fix.

As others noted, this is a case where the test assumed signed chars.  The patch
makes the signedness explicit.

Bootstrapped and regression tested on armv7 and verified the test now passes on
that platform.  Pushing to the trunk.

gcc/testsuite

* gcc.dg/torture/pr126136.c: Make chars explicitly signed.

gcc/testsuite/gcc.dg/torture/pr126136.c

index cc270f51ca2d0e0778cbbcba1999e6fc4f0fe931..0ab01a45d49b4998622529f5db352459de06fc19 100644 (file)
@@ -3,7 +3,7 @@
 int i;
 
 __attribute__ ((noipa,noclone,noinline))
-char foo(char val)
+signed char foo(signed char val)
 {
   i++;
   if (i > 1)