diff options
Diffstat (limited to 'benchtests/bench-pthread-lock-base.c')
-rw-r--r-- | benchtests/bench-pthread-lock-base.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/benchtests/bench-pthread-lock-base.c b/benchtests/bench-pthread-lock-base.c index 0a61557..e94a693 100644 --- a/benchtests/bench-pthread-lock-base.c +++ b/benchtests/bench-pthread-lock-base.c @@ -28,6 +28,7 @@ #include <sys/time.h> #include <sys/sysinfo.h> #include "bench-timing.h" +#include "bench-util.h" #include "json-lib.h" static bench_lock_t lock; @@ -36,10 +37,8 @@ static pthread_barrier_t barrier; #define START_ITERS 1000 -#pragma GCC push_options -#pragma GCC optimize(1) - -static int __attribute__ ((noinline)) fibonacci (int i) +static int __attribute__ ((noinline)) attribute_optimize (1) +fibonacci (int i) { asm(""); if (i > 2) @@ -48,6 +47,7 @@ static int __attribute__ ((noinline)) fibonacci (int i) } static void +attribute_optimize (1) do_filler (void) { char buf1[512], buf2[512]; @@ -56,6 +56,7 @@ do_filler (void) } static void +attribute_optimize (1) do_filler_shared (void) { static char buf1[512], buf2[512]; @@ -63,8 +64,6 @@ do_filler_shared (void) memcpy (buf1, buf2, f); } -#pragma GCC pop_options - #define UNIT_WORK_CRT do_filler_shared () #define UNIT_WORK_NON_CRT do_filler () |