From: Ben Pfaff Date: Tue, 20 Jan 2009 06:32:57 +0000 (-0800) Subject: Remove unnecessary optimization barrier. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b458804e1d0a460fb1c90f06f495b9f7a972424;p=pintos-anon Remove unnecessary optimization barrier. The compiler can't optimize out the load of "ticks" here because it can't look into intr_disable() and intr_set_level() and know that they don't modify "ticks". Thanks to Martin for pointing this out. --- diff --git a/src/devices/timer.c b/src/devices/timer.c index c97667f..befaaae 100644 --- a/src/devices/timer.c +++ b/src/devices/timer.c @@ -73,7 +73,6 @@ timer_ticks (void) enum intr_level old_level = intr_disable (); int64_t t = ticks; intr_set_level (old_level); - barrier (); return t; }