]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Fix reduc_strict_run-1 test case.
authorRobin Dapp <rdapp@ventanamicro.com>
Tue, 15 Aug 2023 15:15:58 +0000 (17:15 +0200)
committerRobin Dapp <rdapp@ventanamicro.com>
Thu, 24 Aug 2023 11:12:49 +0000 (13:12 +0200)
This patch fixes the reduc_strict_run-1 testcase by introducing
a variable that holds the reference result.  This is necessary
because in presence of _Float16 emulation an intermediate
result used in a comparison is computed in higher precision.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/reduc/reduc_strict_run-1.c:
Add variable to hold reference result.

gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc_strict_run-1.c

index 516be97e9eb5bd550634606f0346ed7e847b9610..39c36ef6307b19c99c0025241d4f07a044e8139e 100644 (file)
@@ -17,7 +17,8 @@
        asm volatile ("" ::: "memory");         \
       }                                                \
     TYPE res = reduc_plus_##TYPE (a, b);       \
-    if (res != r * q)                          \
+    TYPE ref = r * q;                          \
+    if (res != ref)                            \
       __builtin_abort ();                      \
   }