The compiler doesn't know that a random value based on global.nbthread
is necessarily smaller than MAX_THREADS, and when picking a random
thread number while single-threaded it complains that new_tid 1 is
out of bounds for the array. In fact all this is dead code in this
case.
Let's tell it about it to silence the warning.
if (new_tid == tid)
continue;
+
+ ASSUME(new_tid < MAX_THREADS);
if (ha_thread_ctx[new_tid].rq_total * 2 < th_ctx->rq_total) {
int cur_state;
do {