From: Godmar Back Date: Fri, 10 Nov 2006 02:20:08 +0000 (+0000) Subject: make loop counter volatile to prevent gcc4.1 from optimizing away entire loop body X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db7d1db11685c1dc0d97c41049d26b876211551b;p=pintos-anon make loop counter volatile to prevent gcc4.1 from optimizing away entire loop body --- 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;