diff options
author | Siddhesh Poyarekar <siddhesh@redhat.com> | 2013-05-17 19:10:33 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@redhat.com> | 2013-05-17 19:10:33 +0530 |
commit | 48a18de1e1e7dfeab6d034765caaf732b53cfcb7 (patch) | |
tree | 1710f87c334a2d5cc79c30f9262212697eb814ef /benchtests | |
parent | 13d3b41a36c4f28d171a144f8a9baad3a8835981 (diff) | |
download | glibc-48a18de1e1e7dfeab6d034765caaf732b53cfcb7.tar glibc-48a18de1e1e7dfeab6d034765caaf732b53cfcb7.tar.gz glibc-48a18de1e1e7dfeab6d034765caaf732b53cfcb7.tar.bz2 glibc-48a18de1e1e7dfeab6d034765caaf732b53cfcb7.zip |
Prevent optimizing out of benchmark function call
Resolves: #15424
The compiler would optimize the benchmark function call out of the
loop and call it only once, resulting in blazingly fast times for some
benchmarks (notably atan, sin and cos). Mark the inputs as volatile
so that the code is forced to read again from the input for each
iteration.
Diffstat (limited to 'benchtests')
-rw-r--r-- | benchtests/bench-modf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/benchtests/bench-modf.c b/benchtests/bench-modf.c index 7fae7dc6ac..2b50665b7e 100644 --- a/benchtests/bench-modf.c +++ b/benchtests/bench-modf.c @@ -21,7 +21,7 @@ extern double modf (double, double *); struct args { - double arg0; + volatile double arg0; } in[] = { { 42.42 }, |