From 48a18de1e1e7dfeab6d034765caaf732b53cfcb7 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Fri, 17 May 2013 19:10:33 +0530 Subject: 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. --- benchtests/bench-modf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'benchtests') diff --git a/benchtests/bench-modf.c b/benchtests/bench-modf.c index 7fae7dc..2b50665 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 }, -- cgit v1.1