about summary refs log tree commit diff
path: root/benchtests/scripts
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh.poyarekar@linaro.org>2015-11-17 16:01:15 +0530
committerSiddhesh Poyarekar <siddhesh.poyarekar@linaro.org>2015-11-17 16:01:15 +0530
commit4916acd87b22351c9d77babf5be71fb8c53d67bd (patch)
tree71b5f474bef73b9ad10b676ab9a4d90abc8658a2 /benchtests/scripts
parentb43e85786f6a6954c3d750aa2914b6ceecade378 (diff)
downloadglibc-4916acd87b22351c9d77babf5be71fb8c53d67bd.tar.gz
glibc-4916acd87b22351c9d77babf5be71fb8c53d67bd.tar.xz
glibc-4916acd87b22351c9d77babf5be71fb8c53d67bd.zip
benchtests: Mark output variables as used
Prevent function calls that don't return anything from being optimized
out by the compiler by marking its input variables as used.

This prevents the sincos function call from being optimized out in the
benchmark.
Diffstat (limited to 'benchtests/scripts')
-rwxr-xr-xbenchtests/scripts/bench.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/benchtests/scripts/bench.py b/benchtests/scripts/bench.py
index ee856db821..7752c8a7fb 100755
--- a/benchtests/scripts/bench.py
+++ b/benchtests/scripts/bench.py
@@ -164,7 +164,7 @@ def _print_arg_data(func, directives, all_vals):
             if pos == -1:
                 die('Output argument must be a pointer type')
 
-            outargs.append('static %s out%d;' % (arg[1:pos], i))
+            outargs.append('static %s out%d __attribute__((used));' % (arg[1:pos], i))
             func_args.append(' &out%d' % i)
         else:
             arg_struct.append('  %s volatile arg%d;' % (arg, i))