From: Siddhesh Poyarekar Date: Tue, 17 Nov 2015 10:31:15 +0000 (+0530) Subject: benchtests: Mark output variables as used X-Git-Tag: glibc-2.23~193 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4916acd87b22351c9d77babf5be71fb8c53d67bd;p=thirdparty%2Fglibc.git 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. --- diff --git a/ChangeLog b/ChangeLog index dd5a2b5b18a..2d53b2b4ae7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-11-17 Siddhesh Poyarekar + + * benchtests/scripts/bench.py (_print_arg_data): Mark output variables + as used. + 2015-11-16 Florian Weimer * math/test-signgam-finite-c99.c (_Mlong_double_): Undefine. diff --git a/benchtests/scripts/bench.py b/benchtests/scripts/bench.py index ee856db8212..7752c8a7fb3 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))