[COMMITTED] benchtests: Fix warning in bench-strchr.c

Wilco Dijkstra Wilco.Dijkstra@arm.com
Mon Sep 22 12:52:44 GMT 2025


Ensure benchtests compile with trunk GCC.

Committed as obvious.

---

diff --git a/benchtests/bench-strchr.c b/benchtests/bench-strchr.c
index 89a085e69fe836beea9eb9ac4b9a315f5d91ad10..63bb9552de9bcce98b6c00c99fe327e00344fc6c 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);
 


More information about the Libc-alpha mailing list