From db7d1db11685c1dc0d97c41049d26b876211551b Mon Sep 17 00:00:00 2001 From: Godmar Back Date: Fri, 10 Nov 2006 02:20:08 +0000 Subject: [PATCH] make loop counter volatile to prevent gcc4.1 from optimizing away entire loop body --- src/devices/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/timer.c b/src/devices/timer.c index c8c41d5..070c487 100644 --- a/src/devices/timer.c +++ b/src/devices/timer.c @@ -162,7 +162,7 @@ too_many_loops (unsigned loops) differently in different places the results would be difficult to predict. */ static void NO_INLINE -busy_wait (int64_t loops) +busy_wait (volatile int64_t loops) { while (loops-- > 0) continue; -- 2.30.2