mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
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.
This commit is contained in:
@ -71,7 +71,7 @@ else {
|
||||
$decl = "$decl,";
|
||||
}
|
||||
|
||||
$arg_struct = "$arg_struct $arg arg$num;";
|
||||
$arg_struct = "$arg_struct volatile $arg arg$num;";
|
||||
$bench_func = "$bench_func variants[v].in[i].arg$num";
|
||||
$decl = "$decl $arg";
|
||||
$num = $num + 1;
|
||||
|
Reference in New Issue
Block a user