[committed] RISC-V: Clean up testsuite for multi-lib testing [NFC]

Message ID 20240105083908.349586-1-kito.cheng@sifive.com
State Unresolved
Headers
Series [committed] RISC-V: Clean up testsuite for multi-lib testing [NFC] |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Kito Cheng Jan. 5, 2024, 8:39 a.m. UTC
  - Drop unnecessary including for stdlib.h and math.h
- Drop assert.h / assert, use __builtin_abort instead.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h:
	Use __builtin_abort instead of assert.
	* gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c: Drop math.h.
	* gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c: Ditto.
	* gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c: Ditto.
	* gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c: Ditto.
	* gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c: Ditto.
	* gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c: Ditto.
	* gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c: Ditto.
	* gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c: Ditto.
	* gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c: Ditto.
	* gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c: Ditto.
	* gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c: Ditto.
	* gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c: Ditto.
	* gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c: Ditto.
	* gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c: Ditto.
	* gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c: Ditto.
	* gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c: Ditto.
	* gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h: Use
	__builtin_abort instead of assert.
	* gcc.target/riscv/rvv/autovec/pr112694-1.c: Ditto.
	* gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h: Ditto.
	* gcc.target/riscv/rvv/autovec/unop/abs-template.h: Drop stdlib.h.
	* gcc.target/riscv/rvv/autovec/unop/vneg-template.h: Ditto.
	* gcc.target/riscv/rvv/autovec/unop/vnot-template.h: Ditto.
---
 .../rvv/autovec/binop/shift-scalar-template.h |  5 +-
 .../riscv/rvv/autovec/cond/cond_fmax-1.c      |  1 -
 .../riscv/rvv/autovec/cond/cond_fmax-2.c      |  1 -
 .../riscv/rvv/autovec/cond/cond_fmax-3.c      |  1 -
 .../riscv/rvv/autovec/cond/cond_fmax-4.c      |  1 -
 .../riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c |  1 -
 .../riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c |  1 -
 .../riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c |  1 -
 .../riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c |  1 -
 .../riscv/rvv/autovec/cond/cond_fmin-1.c      |  1 -
 .../riscv/rvv/autovec/cond/cond_fmin-2.c      |  1 -
 .../riscv/rvv/autovec/cond/cond_fmin-3.c      |  1 -
 .../riscv/rvv/autovec/cond/cond_fmin-4.c      |  1 -
 .../riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c |  1 -
 .../riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c |  1 -
 .../riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c |  1 -
 .../riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c |  1 -
 .../rvv/autovec/partial/single_rgroup-2.h     |  9 ++-
 .../rvv/autovec/partial/single_rgroup-3.h     | 73 ++++++++++++++-----
 .../gcc.target/riscv/rvv/autovec/pr112694-1.c |  4 +-
 .../riscv/rvv/autovec/unop/abs-template.h     |  1 -
 .../riscv/rvv/autovec/unop/vneg-template.h    |  1 -
 .../riscv/rvv/autovec/unop/vnot-template.h    |  1 -
 23 files changed, 63 insertions(+), 47 deletions(-)
  

Comments

juzhe.zhong@rivai.ai Jan. 6, 2024, 2:06 a.m. UTC | #1
Hi, kito.

This patch causes these following regression FAILs:

FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)

spawn -ignore SIGHUP /work/home/jzzhong/work/docker/riscv-gnu-toolchain/build/dev-rv64gcv-lp64d-medany-newlib-spike-release-m1-scalable/build-gcc-newlib-stage2/gcc/xgcc -B/work/home/jzzhong/work/docker/riscv-gnu-toolchain/build/dev-rv64gcv-lp64d-medany-newlib-spike-release-m1-scalable/build-gcc-newlib-stage2/gcc/ /work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c -march=rv64gcv -mabi=lp64d -mcmodel=medany -fdiagnostics-plain-output -ftree-vectorize -O2 --param riscv-autovec-lmul=m1 --param riscv-autovec-preference=scalable -lm -o ./single_rgroup_run-3.exe^M
In file included from /work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.c:4,^M
                 from /work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c:4:^M
/work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c: In function 'main':^M
/work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h:108:9: error: implicit declaration of function 'assert' [-Wimplicit-function-declaration]^M
/work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h:174:3: note: in expansion of macro 'run_6'^M
/work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c:16:3: note: in expansion of macro 'TEST_ALL'^M
/work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h:108:9: note: 'assert' is defined in header '<assert.h>'; this is probably fixable by adding '#include <assert.h>'^M
/work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h:174:3: note: in expansion of macro 'run_6'^M
/work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c:16:3: note: in expansion of macro 'TEST_ALL'^M
compiler exited with status 1
FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
Excess errors:
/work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h:108:9: error: implicit declaration of function 'assert' [-Wimplicit-function-declaration]

UNRESOLVED: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c compilation failed to produce executable


Could you fix it ?



juzhe.zhong@rivai.ai
 
From: Kito Cheng
Date: 2024-01-05 16:39
To: gcc-patches; kito.cheng; juzhe.zhong
CC: Kito Cheng
Subject: [committed] RISC-V: Clean up testsuite for multi-lib testing [NFC]
- Drop unnecessary including for stdlib.h and math.h
- Drop assert.h / assert, use __builtin_abort instead.
 
gcc/testsuite/ChangeLog:
 
* gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h:
Use __builtin_abort instead of assert.
* gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c: Drop math.h.
* gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c: Ditto.
* gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c: Ditto.
* gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h: Use
__builtin_abort instead of assert.
* gcc.target/riscv/rvv/autovec/pr112694-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h: Ditto.
* gcc.target/riscv/rvv/autovec/unop/abs-template.h: Drop stdlib.h.
* gcc.target/riscv/rvv/autovec/unop/vneg-template.h: Ditto.
* gcc.target/riscv/rvv/autovec/unop/vnot-template.h: Ditto.
---
.../rvv/autovec/binop/shift-scalar-template.h |  5 +-
.../riscv/rvv/autovec/cond/cond_fmax-1.c      |  1 -
.../riscv/rvv/autovec/cond/cond_fmax-2.c      |  1 -
.../riscv/rvv/autovec/cond/cond_fmax-3.c      |  1 -
.../riscv/rvv/autovec/cond/cond_fmax-4.c      |  1 -
.../riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c |  1 -
.../riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c |  1 -
.../riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c |  1 -
.../riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c |  1 -
.../riscv/rvv/autovec/cond/cond_fmin-1.c      |  1 -
.../riscv/rvv/autovec/cond/cond_fmin-2.c      |  1 -
.../riscv/rvv/autovec/cond/cond_fmin-3.c      |  1 -
.../riscv/rvv/autovec/cond/cond_fmin-4.c      |  1 -
.../riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c |  1 -
.../riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c |  1 -
.../riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c |  1 -
.../riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c |  1 -
.../rvv/autovec/partial/single_rgroup-2.h     |  9 ++-
.../rvv/autovec/partial/single_rgroup-3.h     | 73 ++++++++++++++-----
.../gcc.target/riscv/rvv/autovec/pr112694-1.c |  4 +-
.../riscv/rvv/autovec/unop/abs-template.h     |  1 -
.../riscv/rvv/autovec/unop/vneg-template.h    |  1 -
.../riscv/rvv/autovec/unop/vnot-template.h    |  1 -
23 files changed, 63 insertions(+), 47 deletions(-)
 
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h
index 8d1cefdca85..2cf645af26e 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h
@@ -3,7 +3,6 @@
/* { dg-additional-options "-std=c99 --param=riscv-autovec-preference=scalable -fno-vect-cost-model --save-temps" } */
#include <stdint-gcc.h>
-#include <assert.h>
#define SHIFTL(TYPE,VAL) \
   __attribute__ ((noipa))                               \
@@ -64,7 +63,7 @@ TEST_ALL()
     a##TYPE##VAL[i] = 2; \
   vsll_##TYPE_##VAL (a##TYPE##VAL, SZ); \
   for (int i = 0; i < SZ; i++)   \
-    assert (a##TYPE##VAL[i] == (2ll << VAL));
+    if (a##TYPE##VAL[i] != (2ll << VAL)) __builtin_abort ();
__attribute__((noipa))
void vsllvx (uint32_t *dst, int val, int n)
@@ -79,7 +78,7 @@ void vsllvx (uint32_t *dst, int val, int n)
     a[i] = 2; \
   vsllvx (a, 17, SZ); \
   for (int i = 0; i < SZ; i++)   \
-    assert (a[i] == (2 << 17));
+    if (a[i] != (2 << 17)) __builtin_abort ();
int main ()
{
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c
index 25c35cf0607..fedee13aab8 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c
@@ -2,7 +2,6 @@
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
#include <stdint-gcc.h>
-#include <math.h>
#ifndef FN
#define FN(X) __builtin_fmax##X
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c
index 17f86238b0f..76f69e44f2c 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c
@@ -2,7 +2,6 @@
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
#include <stdint-gcc.h>
-#include <math.h>
#ifndef FN
#define FN(X) __builtin_fmax##X
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c
index 9a29b52de3d..bb8d1ae61f1 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c
@@ -2,7 +2,6 @@
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
#include <stdint-gcc.h>
-#include <math.h>
#ifndef FN
#define FN(X) __builtin_fmax##X
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c
index cba6cdf2a0f..e4bb3838cb7 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c
@@ -2,7 +2,6 @@
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
#include <stdint-gcc.h>
-#include <math.h>
#ifndef FN
#define FN(X) __builtin_fmax##X
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c
index c6929a7c101..1afa2f2a6db 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c
@@ -2,7 +2,6 @@
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
#include <stdint-gcc.h>
-#include <math.h>
#ifndef FN
#define FN(X) __builtin_fmax##X
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c
index b8a184161f9..23762b799c4 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c
@@ -2,7 +2,6 @@
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
#include <stdint-gcc.h>
-#include <math.h>
#ifndef FN
#define FN(X) __builtin_fmax##X
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c
index af06f11b99d..1837fda2414 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c
@@ -2,7 +2,6 @@
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
#include <stdint-gcc.h>
-#include <math.h>
#ifndef FN
#define FN(X) __builtin_fmax##X
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c
index e6a5a76ca46..766e42cab2e 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c
@@ -2,7 +2,6 @@
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
#include <stdint-gcc.h>
-#include <math.h>
#ifndef FN
#define FN(X) __builtin_fmax##X
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c
index 2c8fbfb0c9e..59b22dbc8cf 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c
@@ -2,7 +2,6 @@
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
#include <stdint-gcc.h>
-#include <math.h>
#define FN(X) __builtin_fmin##X
#include "cond_fmax-1.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c
index fe0455412ba..500c4bcf526 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c
@@ -2,7 +2,6 @@
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
#include <stdint-gcc.h>
-#include <math.h>
#define FN(X) __builtin_fmin##X
#include "cond_fmax-2.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c
index e76361c94ba..85b9238cee9 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c
@@ -2,7 +2,6 @@
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
#include <stdint-gcc.h>
-#include <math.h>
#define FN(X) __builtin_fmin##X
#include "cond_fmax-3.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c
index 9399a4027ff..5ec7fd7a023 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c
@@ -2,7 +2,6 @@
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
#include <stdint-gcc.h>
-#include <math.h>
#define FN(X) __builtin_fmin##X
#include "cond_fmax-4.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c
index 77bc6e7a77e..a839dc3a1d3 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c
@@ -2,7 +2,6 @@
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
#include <stdint-gcc.h>
-#include <math.h>
#define FN(X) __builtin_fmin##X
#include "cond_fmax_zvfh-1.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c
index 8e330afac83..7a3fca26146 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c
@@ -2,7 +2,6 @@
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
#include <stdint-gcc.h>
-#include <math.h>
#define FN(X) __builtin_fmin##X
#include "cond_fmax_zvfh-2.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c
index 5caeac9b4e1..ed0493691f7 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c
@@ -2,7 +2,6 @@
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
#include <stdint-gcc.h>
-#include <math.h>
#define FN(X) __builtin_fmin##X
#include "cond_fmax_zvfh-3.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c
index 8281dc688e7..3ba72d29095 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c
@@ -2,7 +2,6 @@
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
#include <stdint-gcc.h>
-#include <math.h>
#define FN(X) __builtin_fmin##X
#include "cond_fmax_zvfh-4.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h
index a94f3eb0f06..a3c529572ef 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h
@@ -1,4 +1,3 @@
-#include <assert.h>
#include <stdint-gcc.h>
#define N 777
@@ -25,9 +24,13 @@
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond_##TYPE[i] && i < 8)                                             \
- assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+   if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+ }                                                                      \
       else                                                                     \
- assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+   if (b_##TYPE[i] == 0) __builtin_abort();                             \
+ }                                                                      \
     }
#define TEST_ALL(T)                                                            \
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h
index e60e0b1ae33..604e9048055 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h
@@ -1,4 +1,3 @@
-#include <assert.h>
#include <stdint-gcc.h>
#define N 777
@@ -22,9 +21,13 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 5)                                                    \
- assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }        \
       else                                                                     \
- assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }        \
     }
#define run_2(TYPE)                                                            \
@@ -34,9 +37,13 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 17)                                                   \
- assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }        \
       else                                                                     \
- assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }        \
     }
#define run_3(TYPE)                                                            \
@@ -46,9 +53,13 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 32)                                                   \
- assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }        \
       else                                                                     \
- assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }        \
     }
#define run_4(TYPE)                                                            \
@@ -58,9 +69,13 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 128)                                                  \
- assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }        \
       else                                                                     \
- assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }        \
     }
#define run_5(TYPE)                                                            \
@@ -70,9 +85,13 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 177)                                                  \
- assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }        \
       else                                                                     \
- assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }        \
     }
#define run_6(TYPE)                                                            \
@@ -82,7 +101,9 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 255)                                                  \
- assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }        \
       else                                                                     \
assert (b_##TYPE[i] == 0);                                             \
     }
@@ -94,9 +115,13 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 333)                                                  \
- assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }        \
       else                                                                     \
- assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }        \
     }
#define run_8(TYPE)                                                            \
@@ -106,9 +131,13 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 512)                                                  \
- assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }        \
       else                                                                     \
- assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }        \
     }
#define run_9(TYPE)                                                            \
@@ -118,7 +147,9 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 637)                                                  \
- assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }        \
       else                                                                     \
assert (b_##TYPE[i] == 0);                                             \
     }
@@ -130,9 +161,13 @@ int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 777)                                                  \
- assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }        \
       else                                                                     \
- assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }        \
     }
#define TEST_ALL(T)                                                            \
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112694-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112694-1.c
index 8c7f7a980e4..f50df658a9a 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112694-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112694-1.c
@@ -16,8 +16,6 @@
TEST_ALL()
-#include <assert.h>
-
#define SZ 512
#define RUN(TYPE, VAL)                                                         \
@@ -30,7 +28,7 @@ TEST_ALL()
     }                                                                          \
   vmul_##TYPE (a##TYPE, a##TYPE, b##TYPE, SZ);                                 \
   for (int i = 0; i < SZ; i++)                                                 \
-    assert (a##TYPE[i] == 2 * VAL);
+    if (a##TYPE[i] != 2 * VAL) __builtin_abort ();
#define RUN_ALL() \
  RUN(_Float16, 4) \
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/abs-template.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/abs-template.h
index 08bd5b3629c..851515ef6d7 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/abs-template.h
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/abs-template.h
@@ -1,4 +1,3 @@
-#include <stdlib.h>
#include <stdint-gcc.h>
#define TEST_TYPE(TYPE) \
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vneg-template.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vneg-template.h
index 892d9d72c38..e4e5e71ef2f 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vneg-template.h
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vneg-template.h
@@ -1,4 +1,3 @@
-#include <stdlib.h>
#include <stdint-gcc.h>
#define TEST_TYPE(TYPE) \
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vnot-template.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vnot-template.h
index 747375ead80..1eedcc0b559 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vnot-template.h
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vnot-template.h
@@ -1,4 +1,3 @@
-#include <stdlib.h>
#include <stdint-gcc.h>
#define TEST_TYPE(TYPE) \
-- 
2.34.1
  
Kito Cheng Jan. 8, 2024, 3:43 a.m. UTC | #2
ack, I am fixing this, and running a few more tests, thanks for reporting this!

On Sat, Jan 6, 2024 at 10:06 AM 钟居哲 <juzhe.zhong@rivai.ai> wrote:
>
> Hi, kito.
>
> This patch causes these following regression FAILs:
>
> FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
> FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
> FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
> FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
> FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
> FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
> FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
> FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
> FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
> FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
>
> spawn -ignore SIGHUP /work/home/jzzhong/work/docker/riscv-gnu-toolchain/build/dev-rv64gcv-lp64d-medany-newlib-spike-release-m1-scalable/build-gcc-newlib-stage2/gcc/xgcc -B/work/home/jzzhong/work/docker/riscv-gnu-toolchain/build/dev-rv64gcv-lp64d-medany-newlib-spike-release-m1-scalable/build-gcc-newlib-stage2/gcc/ /work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c -march=rv64gcv -mabi=lp64d -mcmodel=medany -fdiagnostics-plain-output -ftree-vectorize -O2 --param riscv-autovec-lmul=m1 --param riscv-autovec-preference=scalable -lm -o ./single_rgroup_run-3.exe^M
> In file included from /work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.c:4,^M
>                  from /work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c:4:^M
> /work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c: In function 'main':^M
> /work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h:108:9: error: implicit declaration of function 'assert' [-Wimplicit-function-declaration]^M
> /work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h:174:3: note: in expansion of macro 'run_6'^M
> /work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c:16:3: note: in expansion of macro 'TEST_ALL'^M
> /work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h:108:9: note: 'assert' is defined in header '<assert.h>'; this is probably fixable by adding '#include <assert.h>'^M
> /work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h:174:3: note: in expansion of macro 'run_6'^M
> /work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c:16:3: note: in expansion of macro 'TEST_ALL'^M
> compiler exited with status 1
> FAIL: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c (test for excess errors)
> Excess errors:
> /work/home/jzzhong/work/docker/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h:108:9: error: implicit declaration of function 'assert' [-Wimplicit-function-declaration]
>
> UNRESOLVED: gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-3.c compilation failed to produce executable
>
>
> Could you fix it ?
>
> ________________________________
> juzhe.zhong@rivai.ai
>
>
> From: Kito Cheng
> Date: 2024-01-05 16:39
> To: gcc-patches; kito.cheng; juzhe.zhong
> CC: Kito Cheng
> Subject: [committed] RISC-V: Clean up testsuite for multi-lib testing [NFC]
> - Drop unnecessary including for stdlib.h and math.h
> - Drop assert.h / assert, use __builtin_abort instead.
>
> gcc/testsuite/ChangeLog:
>
> * gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h:
> Use __builtin_abort instead of assert.
> * gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c: Drop math.h.
> * gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c: Ditto.
> * gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c: Ditto.
> * gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c: Ditto.
> * gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c: Ditto.
> * gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c: Ditto.
> * gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c: Ditto.
> * gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c: Ditto.
> * gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c: Ditto.
> * gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c: Ditto.
> * gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c: Ditto.
> * gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c: Ditto.
> * gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c: Ditto.
> * gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c: Ditto.
> * gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c: Ditto.
> * gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c: Ditto.
> * gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h: Use
> __builtin_abort instead of assert.
> * gcc.target/riscv/rvv/autovec/pr112694-1.c: Ditto.
> * gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h: Ditto.
> * gcc.target/riscv/rvv/autovec/unop/abs-template.h: Drop stdlib.h.
> * gcc.target/riscv/rvv/autovec/unop/vneg-template.h: Ditto.
> * gcc.target/riscv/rvv/autovec/unop/vnot-template.h: Ditto.
> ---
> .../rvv/autovec/binop/shift-scalar-template.h |  5 +-
> .../riscv/rvv/autovec/cond/cond_fmax-1.c      |  1 -
> .../riscv/rvv/autovec/cond/cond_fmax-2.c      |  1 -
> .../riscv/rvv/autovec/cond/cond_fmax-3.c      |  1 -
> .../riscv/rvv/autovec/cond/cond_fmax-4.c      |  1 -
> .../riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c |  1 -
> .../riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c |  1 -
> .../riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c |  1 -
> .../riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c |  1 -
> .../riscv/rvv/autovec/cond/cond_fmin-1.c      |  1 -
> .../riscv/rvv/autovec/cond/cond_fmin-2.c      |  1 -
> .../riscv/rvv/autovec/cond/cond_fmin-3.c      |  1 -
> .../riscv/rvv/autovec/cond/cond_fmin-4.c      |  1 -
> .../riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c |  1 -
> .../riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c |  1 -
> .../riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c |  1 -
> .../riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c |  1 -
> .../rvv/autovec/partial/single_rgroup-2.h     |  9 ++-
> .../rvv/autovec/partial/single_rgroup-3.h     | 73 ++++++++++++++-----
> .../gcc.target/riscv/rvv/autovec/pr112694-1.c |  4 +-
> .../riscv/rvv/autovec/unop/abs-template.h     |  1 -
> .../riscv/rvv/autovec/unop/vneg-template.h    |  1 -
> .../riscv/rvv/autovec/unop/vnot-template.h    |  1 -
> 23 files changed, 63 insertions(+), 47 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h
> index 8d1cefdca85..2cf645af26e 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h
> @@ -3,7 +3,6 @@
> /* { dg-additional-options "-std=c99 --param=riscv-autovec-preference=scalable -fno-vect-cost-model --save-temps" } */
> #include <stdint-gcc.h>
> -#include <assert.h>
> #define SHIFTL(TYPE,VAL) \
>    __attribute__ ((noipa))                               \
> @@ -64,7 +63,7 @@ TEST_ALL()
>      a##TYPE##VAL[i] = 2; \
>    vsll_##TYPE_##VAL (a##TYPE##VAL, SZ); \
>    for (int i = 0; i < SZ; i++)   \
> -    assert (a##TYPE##VAL[i] == (2ll << VAL));
> +    if (a##TYPE##VAL[i] != (2ll << VAL)) __builtin_abort ();
> __attribute__((noipa))
> void vsllvx (uint32_t *dst, int val, int n)
> @@ -79,7 +78,7 @@ void vsllvx (uint32_t *dst, int val, int n)
>      a[i] = 2; \
>    vsllvx (a, 17, SZ); \
>    for (int i = 0; i < SZ; i++)   \
> -    assert (a[i] == (2 << 17));
> +    if (a[i] != (2 << 17)) __builtin_abort ();
> int main ()
> {
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c
> index 25c35cf0607..fedee13aab8 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c
> @@ -2,7 +2,6 @@
> /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
> #include <stdint-gcc.h>
> -#include <math.h>
> #ifndef FN
> #define FN(X) __builtin_fmax##X
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c
> index 17f86238b0f..76f69e44f2c 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c
> @@ -2,7 +2,6 @@
> /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
> #include <stdint-gcc.h>
> -#include <math.h>
> #ifndef FN
> #define FN(X) __builtin_fmax##X
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c
> index 9a29b52de3d..bb8d1ae61f1 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c
> @@ -2,7 +2,6 @@
> /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
> #include <stdint-gcc.h>
> -#include <math.h>
> #ifndef FN
> #define FN(X) __builtin_fmax##X
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c
> index cba6cdf2a0f..e4bb3838cb7 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c
> @@ -2,7 +2,6 @@
> /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
> #include <stdint-gcc.h>
> -#include <math.h>
> #ifndef FN
> #define FN(X) __builtin_fmax##X
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c
> index c6929a7c101..1afa2f2a6db 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c
> @@ -2,7 +2,6 @@
> /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
> #include <stdint-gcc.h>
> -#include <math.h>
> #ifndef FN
> #define FN(X) __builtin_fmax##X
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c
> index b8a184161f9..23762b799c4 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c
> @@ -2,7 +2,6 @@
> /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
> #include <stdint-gcc.h>
> -#include <math.h>
> #ifndef FN
> #define FN(X) __builtin_fmax##X
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c
> index af06f11b99d..1837fda2414 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c
> @@ -2,7 +2,6 @@
> /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
> #include <stdint-gcc.h>
> -#include <math.h>
> #ifndef FN
> #define FN(X) __builtin_fmax##X
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c
> index e6a5a76ca46..766e42cab2e 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c
> @@ -2,7 +2,6 @@
> /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
> #include <stdint-gcc.h>
> -#include <math.h>
> #ifndef FN
> #define FN(X) __builtin_fmax##X
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c
> index 2c8fbfb0c9e..59b22dbc8cf 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c
> @@ -2,7 +2,6 @@
> /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
> #include <stdint-gcc.h>
> -#include <math.h>
> #define FN(X) __builtin_fmin##X
> #include "cond_fmax-1.c"
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c
> index fe0455412ba..500c4bcf526 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c
> @@ -2,7 +2,6 @@
> /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
> #include <stdint-gcc.h>
> -#include <math.h>
> #define FN(X) __builtin_fmin##X
> #include "cond_fmax-2.c"
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c
> index e76361c94ba..85b9238cee9 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c
> @@ -2,7 +2,6 @@
> /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
> #include <stdint-gcc.h>
> -#include <math.h>
> #define FN(X) __builtin_fmin##X
> #include "cond_fmax-3.c"
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c
> index 9399a4027ff..5ec7fd7a023 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c
> @@ -2,7 +2,6 @@
> /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
> #include <stdint-gcc.h>
> -#include <math.h>
> #define FN(X) __builtin_fmin##X
> #include "cond_fmax-4.c"
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c
> index 77bc6e7a77e..a839dc3a1d3 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c
> @@ -2,7 +2,6 @@
> /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
> #include <stdint-gcc.h>
> -#include <math.h>
> #define FN(X) __builtin_fmin##X
> #include "cond_fmax_zvfh-1.c"
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c
> index 8e330afac83..7a3fca26146 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c
> @@ -2,7 +2,6 @@
> /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
> #include <stdint-gcc.h>
> -#include <math.h>
> #define FN(X) __builtin_fmin##X
> #include "cond_fmax_zvfh-2.c"
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c
> index 5caeac9b4e1..ed0493691f7 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c
> @@ -2,7 +2,6 @@
> /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
> #include <stdint-gcc.h>
> -#include <math.h>
> #define FN(X) __builtin_fmin##X
> #include "cond_fmax_zvfh-3.c"
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c
> index 8281dc688e7..3ba72d29095 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c
> @@ -2,7 +2,6 @@
> /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
> #include <stdint-gcc.h>
> -#include <math.h>
> #define FN(X) __builtin_fmin##X
> #include "cond_fmax_zvfh-4.c"
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h
> index a94f3eb0f06..a3c529572ef 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h
> @@ -1,4 +1,3 @@
> -#include <assert.h>
> #include <stdint-gcc.h>
> #define N 777
> @@ -25,9 +24,13 @@
>    for (unsigned int i = 0; i < N; i++)                                         \
>      {                                                                          \
>        if (cond_##TYPE[i] && i < 8)                                             \
> - assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
> +        {                                                                      \
> +   if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
> + }                                                                      \
>        else                                                                     \
> - assert (b_##TYPE[i] == 0);                                             \
> +        {                                                                      \
> +   if (b_##TYPE[i] == 0) __builtin_abort();                             \
> + }                                                                      \
>      }
> #define TEST_ALL(T)                                                            \
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h
> index e60e0b1ae33..604e9048055 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h
> @@ -1,4 +1,3 @@
> -#include <assert.h>
> #include <stdint-gcc.h>
> #define N 777
> @@ -22,9 +21,13 @@ int cond[N] = {0};
>    for (unsigned int i = 0; i < N; i++)                                         \
>      {                                                                          \
>        if (cond[i] && i < 5)                                                    \
> - assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
> +        {                                                                      \
> +          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
> +        }        \
>        else                                                                     \
> - assert (b_##TYPE[i] == 0);                                             \
> +        {                                                                      \
> +          if (b_##TYPE[i] != 0) __builtin_abort();                             \
> +        }        \
>      }
> #define run_2(TYPE)                                                            \
> @@ -34,9 +37,13 @@ int cond[N] = {0};
>    for (unsigned int i = 0; i < N; i++)                                         \
>      {                                                                          \
>        if (cond[i] && i < 17)                                                   \
> - assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
> +        {                                                                      \
> +          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
> +        }        \
>        else                                                                     \
> - assert (b_##TYPE[i] == 0);                                             \
> +        {                                                                      \
> +          if (b_##TYPE[i] != 0) __builtin_abort();                             \
> +        }        \
>      }
> #define run_3(TYPE)                                                            \
> @@ -46,9 +53,13 @@ int cond[N] = {0};
>    for (unsigned int i = 0; i < N; i++)                                         \
>      {                                                                          \
>        if (cond[i] && i < 32)                                                   \
> - assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
> +        {                                                                      \
> +          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
> +        }        \
>        else                                                                     \
> - assert (b_##TYPE[i] == 0);                                             \
> +        {                                                                      \
> +          if (b_##TYPE[i] != 0) __builtin_abort();                             \
> +        }        \
>      }
> #define run_4(TYPE)                                                            \
> @@ -58,9 +69,13 @@ int cond[N] = {0};
>    for (unsigned int i = 0; i < N; i++)                                         \
>      {                                                                          \
>        if (cond[i] && i < 128)                                                  \
> - assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
> +        {                                                                      \
> +          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
> +        }        \
>        else                                                                     \
> - assert (b_##TYPE[i] == 0);                                             \
> +        {                                                                      \
> +          if (b_##TYPE[i] != 0) __builtin_abort();                             \
> +        }        \
>      }
> #define run_5(TYPE)                                                            \
> @@ -70,9 +85,13 @@ int cond[N] = {0};
>    for (unsigned int i = 0; i < N; i++)                                         \
>      {                                                                          \
>        if (cond[i] && i < 177)                                                  \
> - assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
> +        {                                                                      \
> +          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
> +        }        \
>        else                                                                     \
> - assert (b_##TYPE[i] == 0);                                             \
> +        {                                                                      \
> +          if (b_##TYPE[i] != 0) __builtin_abort();                             \
> +        }        \
>      }
> #define run_6(TYPE)                                                            \
> @@ -82,7 +101,9 @@ int cond[N] = {0};
>    for (unsigned int i = 0; i < N; i++)                                         \
>      {                                                                          \
>        if (cond[i] && i < 255)                                                  \
> - assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
> +        {                                                                      \
> +          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
> +        }        \
>        else                                                                     \
> assert (b_##TYPE[i] == 0);                                             \
>      }
> @@ -94,9 +115,13 @@ int cond[N] = {0};
>    for (unsigned int i = 0; i < N; i++)                                         \
>      {                                                                          \
>        if (cond[i] && i < 333)                                                  \
> - assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
> +        {                                                                      \
> +          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
> +        }        \
>        else                                                                     \
> - assert (b_##TYPE[i] == 0);                                             \
> +        {                                                                      \
> +          if (b_##TYPE[i] != 0) __builtin_abort();                             \
> +        }        \
>      }
> #define run_8(TYPE)                                                            \
> @@ -106,9 +131,13 @@ int cond[N] = {0};
>    for (unsigned int i = 0; i < N; i++)                                         \
>      {                                                                          \
>        if (cond[i] && i < 512)                                                  \
> - assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
> +        {                                                                      \
> +          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
> +        }        \
>        else                                                                     \
> - assert (b_##TYPE[i] == 0);                                             \
> +        {                                                                      \
> +          if (b_##TYPE[i] != 0) __builtin_abort();                             \
> +        }        \
>      }
> #define run_9(TYPE)                                                            \
> @@ -118,7 +147,9 @@ int cond[N] = {0};
>    for (unsigned int i = 0; i < N; i++)                                         \
>      {                                                                          \
>        if (cond[i] && i < 637)                                                  \
> - assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
> +        {                                                                      \
> +          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
> +        }        \
>        else                                                                     \
> assert (b_##TYPE[i] == 0);                                             \
>      }
> @@ -130,9 +161,13 @@ int cond[N] = {0};
>    for (unsigned int i = 0; i < N; i++)                                         \
>      {                                                                          \
>        if (cond[i] && i < 777)                                                  \
> - assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
> +        {                                                                      \
> +          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
> +        }        \
>        else                                                                     \
> - assert (b_##TYPE[i] == 0);                                             \
> +        {                                                                      \
> +          if (b_##TYPE[i] != 0) __builtin_abort();                             \
> +        }        \
>      }
> #define TEST_ALL(T)                                                            \
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112694-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112694-1.c
> index 8c7f7a980e4..f50df658a9a 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112694-1.c
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112694-1.c
> @@ -16,8 +16,6 @@
> TEST_ALL()
> -#include <assert.h>
> -
> #define SZ 512
> #define RUN(TYPE, VAL)                                                         \
> @@ -30,7 +28,7 @@ TEST_ALL()
>      }                                                                          \
>    vmul_##TYPE (a##TYPE, a##TYPE, b##TYPE, SZ);                                 \
>    for (int i = 0; i < SZ; i++)                                                 \
> -    assert (a##TYPE[i] == 2 * VAL);
> +    if (a##TYPE[i] != 2 * VAL) __builtin_abort ();
> #define RUN_ALL() \
>   RUN(_Float16, 4) \
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/abs-template.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/abs-template.h
> index 08bd5b3629c..851515ef6d7 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/abs-template.h
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/abs-template.h
> @@ -1,4 +1,3 @@
> -#include <stdlib.h>
> #include <stdint-gcc.h>
> #define TEST_TYPE(TYPE) \
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vneg-template.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vneg-template.h
> index 892d9d72c38..e4e5e71ef2f 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vneg-template.h
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vneg-template.h
> @@ -1,4 +1,3 @@
> -#include <stdlib.h>
> #include <stdint-gcc.h>
> #define TEST_TYPE(TYPE) \
> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vnot-template.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vnot-template.h
> index 747375ead80..1eedcc0b559 100644
> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vnot-template.h
> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vnot-template.h
> @@ -1,4 +1,3 @@
> -#include <stdlib.h>
> #include <stdint-gcc.h>
> #define TEST_TYPE(TYPE) \
> --
> 2.34.1
>
>
  

Patch

diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h
index 8d1cefdca85..2cf645af26e 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h
@@ -3,7 +3,6 @@ 
 /* { dg-additional-options "-std=c99 --param=riscv-autovec-preference=scalable -fno-vect-cost-model --save-temps" } */
 
 #include <stdint-gcc.h>
-#include <assert.h>
 
 #define SHIFTL(TYPE,VAL)				\
   __attribute__ ((noipa))                               \
@@ -64,7 +63,7 @@  TEST_ALL()
     a##TYPE##VAL[i] = 2;		\
   vsll_##TYPE_##VAL (a##TYPE##VAL, SZ);	\
   for (int i = 0; i < SZ; i++)	  	\
-    assert (a##TYPE##VAL[i] == (2ll << VAL));
+    if (a##TYPE##VAL[i] != (2ll << VAL)) __builtin_abort ();
 
 __attribute__((noipa))
 void vsllvx (uint32_t *dst, int val, int n)
@@ -79,7 +78,7 @@  void vsllvx (uint32_t *dst, int val, int n)
     a[i] = 2;		\
   vsllvx (a, 17, SZ);	\
   for (int i = 0; i < SZ; i++)	  	\
-    assert (a[i] == (2 << 17));
+    if (a[i] != (2 << 17)) __builtin_abort ();
 
 int main ()
 {
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c
index 25c35cf0607..fedee13aab8 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-1.c
@@ -2,7 +2,6 @@ 
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #ifndef FN
 #define FN(X) __builtin_fmax##X
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c
index 17f86238b0f..76f69e44f2c 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-2.c
@@ -2,7 +2,6 @@ 
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #ifndef FN
 #define FN(X) __builtin_fmax##X
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c
index 9a29b52de3d..bb8d1ae61f1 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-3.c
@@ -2,7 +2,6 @@ 
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #ifndef FN
 #define FN(X) __builtin_fmax##X
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c
index cba6cdf2a0f..e4bb3838cb7 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax-4.c
@@ -2,7 +2,6 @@ 
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #ifndef FN
 #define FN(X) __builtin_fmax##X
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c
index c6929a7c101..1afa2f2a6db 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-1.c
@@ -2,7 +2,6 @@ 
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #ifndef FN
 #define FN(X) __builtin_fmax##X
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c
index b8a184161f9..23762b799c4 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-2.c
@@ -2,7 +2,6 @@ 
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #ifndef FN
 #define FN(X) __builtin_fmax##X
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c
index af06f11b99d..1837fda2414 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-3.c
@@ -2,7 +2,6 @@ 
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #ifndef FN
 #define FN(X) __builtin_fmax##X
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c
index e6a5a76ca46..766e42cab2e 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmax_zvfh-4.c
@@ -2,7 +2,6 @@ 
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #ifndef FN
 #define FN(X) __builtin_fmax##X
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c
index 2c8fbfb0c9e..59b22dbc8cf 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-1.c
@@ -2,7 +2,6 @@ 
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #define FN(X) __builtin_fmin##X
 #include "cond_fmax-1.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c
index fe0455412ba..500c4bcf526 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-2.c
@@ -2,7 +2,6 @@ 
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #define FN(X) __builtin_fmin##X
 #include "cond_fmax-2.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c
index e76361c94ba..85b9238cee9 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-3.c
@@ -2,7 +2,6 @@ 
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #define FN(X) __builtin_fmin##X
 #include "cond_fmax-3.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c
index 9399a4027ff..5ec7fd7a023 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin-4.c
@@ -2,7 +2,6 @@ 
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #define FN(X) __builtin_fmin##X
 #include "cond_fmax-4.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c
index 77bc6e7a77e..a839dc3a1d3 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-1.c
@@ -2,7 +2,6 @@ 
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #define FN(X) __builtin_fmin##X
 #include "cond_fmax_zvfh-1.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c
index 8e330afac83..7a3fca26146 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-2.c
@@ -2,7 +2,6 @@ 
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #define FN(X) __builtin_fmin##X
 #include "cond_fmax_zvfh-2.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c
index 5caeac9b4e1..ed0493691f7 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-3.c
@@ -2,7 +2,6 @@ 
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #define FN(X) __builtin_fmin##X
 #include "cond_fmax_zvfh-3.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c
index 8281dc688e7..3ba72d29095 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_fmin_zvfh-4.c
@@ -2,7 +2,6 @@ 
 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d --param=riscv-autovec-preference=scalable -fno-vect-cost-model -fno-signaling-nans" } */
 
 #include <stdint-gcc.h>
-#include <math.h>
 
 #define FN(X) __builtin_fmin##X
 #include "cond_fmax_zvfh-4.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h
index a94f3eb0f06..a3c529572ef 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-2.h
@@ -1,4 +1,3 @@ 
-#include <assert.h>
 #include <stdint-gcc.h>
 
 #define N 777
@@ -25,9 +24,13 @@ 
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond_##TYPE[i] && i < 8)                                             \
-	assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+	  if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+	}                                                                      \
       else                                                                     \
-	assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+	  if (b_##TYPE[i] == 0) __builtin_abort();                             \
+	}                                                                      \
     }
 
 #define TEST_ALL(T)                                                            \
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h
index e60e0b1ae33..604e9048055 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-3.h
@@ -1,4 +1,3 @@ 
-#include <assert.h>
 #include <stdint-gcc.h>
 
 #define N 777
@@ -22,9 +21,13 @@  int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 5)                                                    \
-	assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }								       \
       else                                                                     \
-	assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }								       \
     }
 
 #define run_2(TYPE)                                                            \
@@ -34,9 +37,13 @@  int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 17)                                                   \
-	assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }								       \
       else                                                                     \
-	assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }								       \
     }
 
 #define run_3(TYPE)                                                            \
@@ -46,9 +53,13 @@  int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 32)                                                   \
-	assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }								       \
       else                                                                     \
-	assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }								       \
     }
 
 #define run_4(TYPE)                                                            \
@@ -58,9 +69,13 @@  int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 128)                                                  \
-	assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }								       \
       else                                                                     \
-	assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }								       \
     }
 
 #define run_5(TYPE)                                                            \
@@ -70,9 +85,13 @@  int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 177)                                                  \
-	assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }								       \
       else                                                                     \
-	assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }								       \
     }
 
 #define run_6(TYPE)                                                            \
@@ -82,7 +101,9 @@  int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 255)                                                  \
-	assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }								       \
       else                                                                     \
 	assert (b_##TYPE[i] == 0);                                             \
     }
@@ -94,9 +115,13 @@  int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 333)                                                  \
-	assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }								       \
       else                                                                     \
-	assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }								       \
     }
 
 #define run_8(TYPE)                                                            \
@@ -106,9 +131,13 @@  int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 512)                                                  \
-	assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }								       \
       else                                                                     \
-	assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }								       \
     }
 
 #define run_9(TYPE)                                                            \
@@ -118,7 +147,9 @@  int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 637)                                                  \
-	assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }								       \
       else                                                                     \
 	assert (b_##TYPE[i] == 0);                                             \
     }
@@ -130,9 +161,13 @@  int cond[N] = {0};
   for (unsigned int i = 0; i < N; i++)                                         \
     {                                                                          \
       if (cond[i] && i < 777)                                                  \
-	assert (b_##TYPE[i] == a_##TYPE[i]);                                   \
+        {                                                                      \
+          if (b_##TYPE[i] != a_##TYPE[i]) __builtin_abort();                   \
+        }								       \
       else                                                                     \
-	assert (b_##TYPE[i] == 0);                                             \
+        {                                                                      \
+          if (b_##TYPE[i] != 0) __builtin_abort();                             \
+        }								       \
     }
 
 #define TEST_ALL(T)                                                            \
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112694-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112694-1.c
index 8c7f7a980e4..f50df658a9a 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112694-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112694-1.c
@@ -16,8 +16,6 @@ 
 
 TEST_ALL()
 
-#include <assert.h>
-
 #define SZ 512
 
 #define RUN(TYPE, VAL)                                                         \
@@ -30,7 +28,7 @@  TEST_ALL()
     }                                                                          \
   vmul_##TYPE (a##TYPE, a##TYPE, b##TYPE, SZ);                                 \
   for (int i = 0; i < SZ; i++)                                                 \
-    assert (a##TYPE[i] == 2 * VAL);
+    if (a##TYPE[i] != 2 * VAL) __builtin_abort ();
 
 #define RUN_ALL()	\
  RUN(_Float16, 4)	\
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/abs-template.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/abs-template.h
index 08bd5b3629c..851515ef6d7 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/abs-template.h
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/abs-template.h
@@ -1,4 +1,3 @@ 
-#include <stdlib.h>
 #include <stdint-gcc.h>
 
 #define TEST_TYPE(TYPE) 				\
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vneg-template.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vneg-template.h
index 892d9d72c38..e4e5e71ef2f 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vneg-template.h
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vneg-template.h
@@ -1,4 +1,3 @@ 
-#include <stdlib.h>
 #include <stdint-gcc.h>
 
 #define TEST_TYPE(TYPE) 				\
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vnot-template.h b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vnot-template.h
index 747375ead80..1eedcc0b559 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vnot-template.h
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/vnot-template.h
@@ -1,4 +1,3 @@ 
-#include <stdlib.h>
 #include <stdint-gcc.h>
 
 #define TEST_TYPE(TYPE) 				\