summaryrefslogtreecommitdiff
path: root/benchtests
diff options
context:
space:
mode:
authorWilco Dijkstra <wilco.dijkstra@arm.com>2025-09-22 12:39:24 +0000
committerWilco Dijkstra <wilco.dijkstra@arm.com>2025-09-22 12:42:57 +0000
commiteba46f707748a8710c29ce5708792a90dd41c10d (patch)
tree263c84cd3715e2a483283a036f660964dec6f9ba /benchtests
parent9825f9b823f20abdc487e935acebeb69927855ea (diff)
benchtests: Fix warning in bench-strchr.c
Ensure benchtests compile with trunk GCC.
Diffstat (limited to 'benchtests')
-rw-r--r--benchtests/bench-strchr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/benchtests/bench-strchr.c b/benchtests/bench-strchr.c
index 89a085e69f..63bb9552de 100644
--- a/benchtests/bench-strchr.c
+++ b/benchtests/bench-strchr.c
@@ -92,6 +92,9 @@ IMPL (generic_strchrnul, 0)
branch coming we want to test the case where a potential branch in
strchr can be used to skip a later mispredict because of the
relationship between the two branches. */
+
+static volatile int res;
+
static void __attribute_optimization_barrier__
do_one_rand_plus_branch_test (json_ctx_t *json_ctx, impl_t *impl,
const CHAR *s, const CHAR *c)
@@ -111,6 +114,7 @@ do_one_rand_plus_branch_test (json_ctx_t *json_ctx, impl_t *impl,
}
}
TIMING_NOW (stop);
+ res = must_execute;
TIMING_DIFF (cur, start, stop);