Remove unnecessary optimization barrier.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 20 Jan 2009 06:32:57 +0000 (22:32 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 20 Jan 2009 06:32:57 +0000 (22:32 -0800)
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 <mfleener@stanford.edu> for pointing this out.

src/devices/timer.c

index c97667f56bfcd5d9bd70862c7ff3ca2047f8f706..befaaaed5a9a1ac0cd25ab76f8afd96fe6865127 100644 (file)
@@ -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;
 }