For GCN target (tested '-march=gfx90a'), the 'gcc.dg/vect/vect-cond-reduc-in-order-2-signed-zero.c' recently added with PR111401 commit r14-5076-g01c18f58d37865d5f3bbe93e666183b54ec608c7 "ifcvt/vect: Emit COND_OP for conditional scalar reduction" FAILs its execution test: '[...]/build-gcc/gcc/gcn-run' './vect-cond-reduc-in-order-2-signed-zero.exe'; echo XYZ$?ZYX GCN Kernel Aborted Kernel aborted XYZ134ZYX OK> Elapsed time: 199 ms FAIL: gcc.dg/vect/vect-cond-reduc-in-order-2-signed-zero.c execution test As that commit and test case does mention "signed zero", maybe that's where the problem lies?
This test was introduced in order to check that we correctly "reduce" with -0.0 as neutral element, i.e. a reduction preserves an intial -0.0 and doesn't turn it into 0.0 by adding 0.0. Kernel aborted means an assertion failed? Or something else?
Right, that's what I suspected (see my "signed zero" comment). And indeed, the first check in 'main' instrumented as follows: --- gcc/testsuite/gcc.dg/vect/vect-cond-reduc-in-order-2-signed-zero.c +++ gcc/testsuite/gcc.dg/vect/vect-cond-reduc-in-order-2-signed-zero.c @@ -74,8 +74,11 @@ main () double res4 = reduc_minus_double (a, -0.0, cond1, n); double ref4 = reduc_minus_double_ref (a, -0.0, cond1, n); + __builtin_printf("L0\n"); + __builtin_printf("eq %d, SBres 0x%x, SBref 0x%x\n", res1 == ref1, signbit (res1), signbit (ref1)); if (res1 != ref1 || signbit (res1) != signbit (ref1)) __builtin_abort (); + __builtin_printf("L1\n"); ..., I see: L0 eq 1, SBres 0, SBref 80000000 GCN Kernel Aborted Kernel aborted ..., so unexpected 'signbit' difference of '-0.0' '+' reduction, and thus 'abort'. Thus, likely, a GCN target issue -- for Andrew/Julian to take over.
Something in the last few weeks' worth of commits made this go back to PASS: PASS: gcc.dg/vect/vect-cond-reduc-in-order-2-signed-zero.c (test for excess errors) [-FAIL:-]{+PASS:+} gcc.dg/vect/vect-cond-reduc-in-order-2-signed-zero.c execution test
(In reply to Thomas Schwinge from comment #3) > Something in the last few weeks' worth of commits made this go back to PASS: > > PASS: gcc.dg/vect/vect-cond-reduc-in-order-2-signed-zero.c (test for > excess errors) > [-FAIL:-]{+PASS:+} gcc.dg/vect/vect-cond-reduc-in-order-2-signed-zero.c > execution test For posterity: it was commit r15-1187-g2b438a0d2aa80f051a09b245a58f643540d4004b "vect: Merge loop mask and cond_op mask in fold-left reduction [PR115382]" that fixed this for GCN target, too.