From a2b0ff98a0d44259cc5f6bd7d3a3676ae9f8996a Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 23 Dec 2024 05:11:58 +0800 Subject: include/sys/cdefs.h: Add __attribute_optimization_barrier__ Add __attribute_optimization_barrier__ to disable inlining and cloning on a function. For Clang, expand it to __attribute__ ((optnone)) Otherwise, expand it to __attribute__ ((noinline, clone)) Co-Authored-By: H.J. Lu Reviewed-by: Sam James --- string/tst-xbzero-opt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'string') diff --git a/string/tst-xbzero-opt.c b/string/tst-xbzero-opt.c index 2392eaa2c1..0247eec9af 100644 --- a/string/tst-xbzero-opt.c +++ b/string/tst-xbzero-opt.c @@ -97,7 +97,7 @@ static const unsigned char test_pattern[16] = static ucontext_t uc_main, uc_co; -static __attribute__ ((noinline, noclone)) int +static __attribute_optimization_barrier__ int use_test_buffer (unsigned char *buf) { unsigned int sum = 0; -- cgit v1.2.3