From patchwork Sun Dec 22 21:11:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 852957 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp3118504wrq; Sun, 22 Dec 2024 13:13:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVkffx5E0VX5CSk/vX0w6OcPLHpW3C5U5DEyQXFLJO0SA6H0AFR3Oxp0oueo1rogjA2rrLAkA==@linaro.org X-Google-Smtp-Source: AGHT+IGEhIN/aqieIqroaknYoKwaPigbTyg+4LML/2ZAuMduZct8Zj/WgHaS3patpQ0UvAiSmeEi X-Received: by 2002:ad4:5766:0:b0:6d8:8cb0:b40d with SMTP id 6a1803df08f44-6dd2339dfbemr209748636d6.39.1734901988309; Sun, 22 Dec 2024 13:13:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1734901988; cv=pass; d=google.com; s=arc-20240605; b=TC6yqfvGgFlkmLZDEu3LQifRKA8z2l/dnGKw4vUBprvca6fwuRXHByC5oqrKUGCMv0 UrYP0bUpy72ytAnWAAEvbWSpa0QYZB+4FDF0lwM4jRMmbjpo3KTrkkbF0AFXrSq6yT2W m+fhSr/3qqhHIJ/qvod2DCYN0tJ2hjmFfs+ydZpSEl0r0JSmGBTRUnvWvlexGwEknZcZ T48uox70PxgPMDtW3gkibwLCWuKzz2veD0RlmSGjk/PAkeRLsD637rzNfphHs27rXbcX 8Xu0vn4psZvlq4Ll1KJh7VVJwN5sXeZPKL4z7Xm4heKgNpZNomIoblPb8hbzCfpAQHXw brxw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to :dkim-filter; bh=r5g8xfNMEO1nMN9UTvoU5kYvsFHlRPZ1WmySe7gxE5Y=; fh=ht7S/aL0uqTgIO2F8eYRAco/+F1xvyiyQ8JIa/d4CW4=; b=j2oNhmYtOLtNv/T3YuvkFrqdX19+VmkmrPTNlVDOkAyiuK7icr90n8N56h4QYIsIeI 2YKMq1QgS+2OyU4bzykXvubf/KOHU8Vl5m7HKIy7XFaxoqwdLt2uSDk2Pc1L2PBnDvMk lkKvrN8R724KY2ffXy5CSh4+Kb01j9FTDiSEomdv4mTaEi/CD2AwpjYP4yCzck3xYQO3 uTT60pFfrWV35OG+Dg1j1d2hB4cI+UMu13/UgF1CiZfsJDo7tU5zc3gVqnn1yhhrVdtO PyvxFSqvwgqOYQJPrQBpo9Sj1W2mWOS2AsvIc9oJHBUibCEjkTIlbAbrxu2bvMK94t2z YNNQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=b49YWEv0; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd1835bbb7si102127186d6.472.2024.12.22.13.13.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 13:13:08 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=b49YWEv0; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D67E93857C6A for ; Sun, 22 Dec 2024 21:13:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D67E93857C6A Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=b49YWEv0 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 273A73858420 for ; Sun, 22 Dec 2024 21:12:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 273A73858420 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 273A73858420 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::435 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734901941; cv=none; b=x0Xx+1Tync0UrD1FDzlWZp9Sn5Fv+kvWALdxtjQ/b8cEd3V4XFvYW0Aa3kpGmWzFGKLejS5GZjgOLmOHSoySeEZ1g3hkKG27jrv0+ImjBau9f44YMC9DCwnIn+e/VJdyGadTaurB/WqFDQEhABmySyG4aaUPY8xqmyj9pOjo3Sg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734901941; c=relaxed/simple; bh=ZBR2n1dOEeLi02IQEiHg5aLxwBozmckUMUUXgmYCgBw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=b1gIadscKcrm+BwHjlQKLraCGBbW5FdbeJbZneDHR78+4EYOMUvKcF33cHQan4csegS/rTWiO+a2MPfpBp+qClXNBn7Z6UhPBHLxEL4e0V1I3P3gs9dyWY5Cw7XqGBdVdSOB7Oy1LpjpBS1V4uhzPIF83FhQ+7rpYxIvudZ7dmE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-725d9f57d90so2606353b3a.1 for ; Sun, 22 Dec 2024 13:12:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734901940; x=1735506740; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=r5g8xfNMEO1nMN9UTvoU5kYvsFHlRPZ1WmySe7gxE5Y=; b=b49YWEv0vuMLHC5c2yrHAmzAUvwyAv6FZKdJ29VNsSrcuqNMjDdvGJ8I3qPn/+jrqA HX+CYrERexAYwZUL+93iy5ElHXW7HwGimV3aq4BH0RN6vlHBn0JhTG9ujc6vzkT9/UkO nPAEbG0gack9XeX4QtKDMa0eMP1k+zSm+oXJZKUXyJCvHGVSQVhc6ng34SrRblTloWx8 cXCSr49LLQ4fReRu1A/VmXm/dX1zdRbasfthiKGtIoSwh+5vklhWmcYTIhMBTquj30i+ Tuc9/rZr5d4FpqtmRR8nVh9OXNb6k+BTM2QnQ2pSwnV+PqWkBBVNpnw2lY0EUPqzW6Vy RVUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734901940; x=1735506740; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r5g8xfNMEO1nMN9UTvoU5kYvsFHlRPZ1WmySe7gxE5Y=; b=j/rYWqtJaRj6fbN/8caH3WphFjoO54u6M9j45ZQth3KiC/1C+PYgu207OvdDOKBc4C MT7aNdrxrIZhXO5nqT8LcahIHifrLeHwmURmZnsgVCruR2bVGncDOx8J6lrrXBxG9FSQ dR67kUtDoesz3ZeUz5nbkHQlhbBaNaokKURnlOgR6wPshjpp/gxQuLb/czMyt34L7eHi 1xnwJcV6+xvl1am9reQf7ln8dXemqGQTbJs1R6ntkWX5ukjm5RnelUlJjqYR+qdj3c35 dpLp3UTOgqKHWz9GQTzKisBghFanY87oBAU3hToCgbDT8wPoKe8PeWkrUVkACjGApRbC oNQw== X-Gm-Message-State: AOJu0Yz2pFlQOYyUAOZ9ZnKhmqQAvNK9mqgZdmV+PvdfY0h+JEQf3Los g/V9aii22LE1wVB9m4vSPB1LVwcs0WJGDL2MDNsFTFvHTNDytdxn X-Gm-Gg: ASbGnctDC3JO4CAmC1895PVu/9Urawq5TJOuXYWRo84wD758mpCm1bBegxas6qxzlyZ KJf+iJ6M4V1svIA6EEHhGtpiQ5HFf5UrEBLHGpZ0VOagGfEbeHblwuVfUQv7J5m61arzwtXJlDA ZXwCog+zTmy+l6FD1TcrlbezIu05Rx4e2hoMGHF4Ycq2N4sRUO8X9d3e427iPl1oYGgNUfJ1PUv xchFaqd+NncDOoKe2YHaUlrtddRb5fkUIxJMb4R3BCrm8X4Mb7etuUvBfUtikB/huFaRHU= X-Received: by 2002:a05:6a00:a86:b0:728:e27c:a9bc with SMTP id d2e1a72fcca58-72abdd8c46fmr15340416b3a.7.1734901939772; Sun, 22 Dec 2024 13:12:19 -0800 (PST) Received: from gnu-tgl-3.localdomain ([120.204.185.181]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb8f5sm6736485b3a.146.2024.12.22.13.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 13:12:19 -0800 (PST) Received: from gnu-tgl-3.lan (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id 80392C028D; Mon, 23 Dec 2024 05:12:15 +0800 (CST) From: "H.J. Lu" To: libc-alpha@sourceware.org Cc: sam@gentoo.org, schwab@linux-m68k.org, Adhemerval Zanella Subject: [PATCH v2 1/6] include/sys/cdefs.h: Add __attribute_optimization_barrier__ Date: Mon, 23 Dec 2024 05:11:58 +0800 Message-ID: <20241222211203.66704-2-hjl.tools@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241222211203.66704-1-hjl.tools@gmail.com> References: <20241222211203.66704-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patch=linaro.org@sourceware.org From: Adhemerval Zanella 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 --- benchtests/bench-hash-funcs-kernel.h | 4 ++-- benchtests/bench-hash-funcs.c | 2 +- benchtests/bench-strchr.c | 4 ++-- debug/tst-backtrace.h | 2 +- debug/tst-ssp-1.c | 2 +- elf/tst-p_alignmod-base.c | 2 +- gmon/tst-gmon.c | 8 +++++--- gmon/tst-mcount-overflow.c | 10 ++++++---- include/sys/cdefs.h | 7 +++++++ malloc/tst-malloc-thread-exit.c | 2 +- malloc/tst-malloc-thread-fail.c | 2 +- malloc/tst-mallocstate.c | 2 +- misc/tst-syscalls.c | 14 ++++++------- nptl/tst-minstack-throw.cc | 8 ++++---- nptl/tst-thread-exit-clobber.cc | 12 +++++------ nptl/tst-thread_local1.cc | 12 +++++------ stdlib/tst-makecontext-align.c | 20 +++++++++---------- stdlib/tst-quick_exit.cc | 2 +- stdlib/tst-setcontext10.c | 6 +++--- stdlib/tst-setcontext11.c | 2 +- stdlib/tst-setcontext5.c | 4 ++-- stdlib/tst-setcontext8.c | 2 +- stdlib/tst-setcontext9.c | 2 +- stdlib/tst-swapcontext1.c | 8 ++++---- stdlib/tst-swapcontext2.c | 8 ++++---- stdlib/tst-thread-quick_exit.cc | 2 +- string/tst-xbzero-opt.c | 2 +- sysdeps/generic/tst-stack-align.h | 2 +- .../sysv/linux/x86_64/tst-cet-property-2.c | 2 +- .../sysv/linux/x86_64/tst-cet-setcontext-1.c | 2 +- .../unix/sysv/linux/x86_64/tst-cet-vfork-1.c | 2 +- .../sysv/linux/x86_64/tst-gnu2-tls2-amx.c | 2 +- sysdeps/x86/tst-ldbl-nonnormal-printf.c | 2 +- sysdeps/x86/tst-memchr-rtm.c | 4 ++-- sysdeps/x86/tst-memcmp-rtm.c | 4 ++-- sysdeps/x86/tst-memmove-rtm.c | 4 ++-- sysdeps/x86/tst-memrchr-rtm.c | 4 ++-- sysdeps/x86/tst-memset-rtm.c | 4 ++-- sysdeps/x86/tst-strchr-rtm.c | 4 ++-- sysdeps/x86/tst-strcmp-rtm.c | 4 ++-- sysdeps/x86/tst-strcpy-rtm.c | 4 ++-- sysdeps/x86/tst-strlen-rtm.c | 4 ++-- sysdeps/x86/tst-strncmp-rtm.c | 8 ++++---- sysdeps/x86/tst-strrchr-rtm.c | 4 ++-- sysdeps/x86_64/tst-rsi-strlen.c | 2 +- 45 files changed, 112 insertions(+), 101 deletions(-) diff --git a/benchtests/bench-hash-funcs-kernel.h b/benchtests/bench-hash-funcs-kernel.h index 7eaa3665b6..3e58fde084 100644 --- a/benchtests/bench-hash-funcs-kernel.h +++ b/benchtests/bench-hash-funcs-kernel.h @@ -35,7 +35,7 @@ #define PRIMITIVE_CAT(x, y) x ## y #define CAT(x, y) PRIMITIVE_CAT (x, y) -static double __attribute__ ((noinline, noclone)) +static double __attribute_optimization_barrier__ CAT (do_one_test_kernel, POSTFIX) (const char *s, size_t len) { @@ -58,7 +58,7 @@ CAT (do_one_test_kernel, POSTFIX) (const char *s, size_t len) return (double) cur / (double) NFIXED_ITERS; } -static double __attribute__ ((noinline, noclone)) +static double __attribute_optimization_barrier__ CAT (do_rand_test_kernel, POSTFIX) (char const *bufs, unsigned int const *sizes) { diff --git a/benchtests/bench-hash-funcs.c b/benchtests/bench-hash-funcs.c index 8dd88c9e39..3d15029278 100644 --- a/benchtests/bench-hash-funcs.c +++ b/benchtests/bench-hash-funcs.c @@ -67,7 +67,7 @@ do_one_test (json_ctx_t *json_ctx, size_t len) json_element_object_end (json_ctx); } -static void __attribute__ ((noinline, noclone)) +static void __attribute_optimization_barrier__ do_rand_test (json_ctx_t *json_ctx) { size_t i, sz, offset; diff --git a/benchtests/bench-strchr.c b/benchtests/bench-strchr.c index eed6882085..fed3b9b223 100644 --- a/benchtests/bench-strchr.c +++ b/benchtests/bench-strchr.c @@ -92,7 +92,7 @@ IMPL (generic_strchrnul, 0) branch coming we want to test the case where a potential branch in strchr can be used to skip a later mispredict because of the relationship between the two branches. */ -static void __attribute__ ((noinline, noclone)) +static void __attribute_optimization_barrier__ do_one_rand_plus_branch_test (json_ctx_t *json_ctx, impl_t *impl, const CHAR *s, const CHAR *c) { @@ -117,7 +117,7 @@ do_one_rand_plus_branch_test (json_ctx_t *json_ctx, impl_t *impl, json_element_double (json_ctx, (double)cur / (double)iters); } -static void __attribute__ ((noinline, noclone)) +static void __attribute_optimization_barrier__ do_one_rand_test (json_ctx_t *json_ctx, impl_t *impl, const CHAR *s, const CHAR *c) { diff --git a/debug/tst-backtrace.h b/debug/tst-backtrace.h index 53239dad59..0ed38b6892 100644 --- a/debug/tst-backtrace.h +++ b/debug/tst-backtrace.h @@ -33,7 +33,7 @@ volatile int x; /* Use this attribute to prevent inlining, so that all expected frames are present. */ -#define NO_INLINE __attribute__ ((noinline, noclone, weak)) +#define NO_INLINE __attribute__ ((weak)) __attribute_optimization_barrier__ /* Look for a match in SYM from backtrace_symbols to NAME, a fragment of a function name. Ignore the filename before '(', but presume diff --git a/debug/tst-ssp-1.c b/debug/tst-ssp-1.c index a1e4fb0630..2c8861ae59 100644 --- a/debug/tst-ssp-1.c +++ b/debug/tst-ssp-1.c @@ -21,7 +21,7 @@ #include static void -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ test (char *foo) { int i; diff --git a/elf/tst-p_alignmod-base.c b/elf/tst-p_alignmod-base.c index d6930b9f16..23b20f12db 100644 --- a/elf/tst-p_alignmod-base.c +++ b/elf/tst-p_alignmod-base.c @@ -26,7 +26,7 @@ int foo __attribute__ ((aligned (ALIGN))) = 1; bool -__attribute__ ((weak, noclone, noinline)) +__attribute__ ((weak)) __attribute_optimization_barrier__ is_aligned_p (void *p, int align) { return (((uintptr_t) p) & (align - 1)) == 0; diff --git a/gmon/tst-gmon.c b/gmon/tst-gmon.c index 9de4e7f85f..eca8246a5c 100644 --- a/gmon/tst-gmon.c +++ b/gmon/tst-gmon.c @@ -16,15 +16,17 @@ License along with the GNU C Library; if not, see . */ +#include + /* This program does not use the test harness because we want tight control over the call graph. */ -__attribute__ ((noinline, noclone, weak)) void +__attribute__ ((weak)) __attribute_optimization_barrier__ void f1 (void) { } -__attribute__ ((noinline, noclone, weak)) void +__attribute__ ((weak)) __attribute_optimization_barrier__ void f2 (void) { f1 (); @@ -32,7 +34,7 @@ f2 (void) asm volatile (""); } -__attribute__ ((noinline, noclone, weak)) void +__attribute__ ((weak)) __attribute_optimization_barrier__ void f3 (int count) { for (int i = 0; i < count; ++i) diff --git a/gmon/tst-mcount-overflow.c b/gmon/tst-mcount-overflow.c index 0e60f7e2e6..a681872bf7 100644 --- a/gmon/tst-mcount-overflow.c +++ b/gmon/tst-mcount-overflow.c @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include + /* Program with sufficiently complex, yet pointless, call graph that it will trigger an mcount overflow, when you set the minarcs/maxarcs tunables to very low values. */ @@ -31,12 +33,12 @@ /* Defines 16 leaf functions named f1_0 to f1_15 */ #define REP(n) \ - __attribute__ ((noinline, noclone, weak)) void f1_##n (void) {}; + __attribute__ ((weak)) __attribute_optimization_barrier__ void f1_##n (void) {}; REPS #undef REP /* Calls all 16 leaf functions f1_* in succession */ -__attribute__ ((noinline, noclone, weak)) void +__attribute__ ((weak)) __attribute_optimization_barrier__ void f2 (void) { # define REP(n) f1_##n(); @@ -47,12 +49,12 @@ f2 (void) /* Defines 16 functions named f2_0 to f2_15, which all just call f2 */ #define REP(n) \ - __attribute__ ((noinline, noclone, weak)) void \ + __attribute__ ((weak)) __attribute_optimization_barrier__ void \ f2_##n (void) { f2(); PREVENT_TAIL_CALL; }; REPS #undef REP -__attribute__ ((noinline, noclone, weak)) void +__attribute__ ((weak)) __attribute_optimization_barrier__ void f3 (int count) { for (int i = 0; i < count; ++i) diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h index b84ad34a70..a676f75f62 100644 --- a/include/sys/cdefs.h +++ b/include/sys/cdefs.h @@ -56,4 +56,11 @@ rtld_hidden_proto (__chk_fail) #endif /* !defined _ISOMAC */ +/* Prevents a function from being considered for inlining and cloning. */ +#ifdef __clang__ +# define __attribute_optimization_barrier__ __attribute__ ((optnone)) +#else +# define __attribute_optimization_barrier__ __attribute__ ((noinline, noclone)) +#endif + #endif diff --git a/malloc/tst-malloc-thread-exit.c b/malloc/tst-malloc-thread-exit.c index aec3897087..269abcea8c 100644 --- a/malloc/tst-malloc-thread-exit.c +++ b/malloc/tst-malloc-thread-exit.c @@ -42,7 +42,7 @@ static int inner_thread_count = 4; static size_t malloc_size = 32; static void -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ unoptimized_free (void *ptr) { free (ptr); diff --git a/malloc/tst-malloc-thread-fail.c b/malloc/tst-malloc-thread-fail.c index f698871876..56553dd299 100644 --- a/malloc/tst-malloc-thread-fail.c +++ b/malloc/tst-malloc-thread-fail.c @@ -33,7 +33,7 @@ /* Wrapper for calloc with an optimization barrier. */ static void * -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ allocate_zeroed (size_t a, size_t b) { return calloc (a, b); diff --git a/malloc/tst-mallocstate.c b/malloc/tst-mallocstate.c index f72e1a1b28..3664fcda01 100644 --- a/malloc/tst-mallocstate.c +++ b/malloc/tst-mallocstate.c @@ -366,7 +366,7 @@ full_heap_check (void) } /* Used as an optimization barrier to force a heap allocation. */ -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static void my_free (void *ptr) { diff --git a/misc/tst-syscalls.c b/misc/tst-syscalls.c index d060b125c9..ac1e1014e1 100644 --- a/misc/tst-syscalls.c +++ b/misc/tst-syscalls.c @@ -37,7 +37,7 @@ struct Array static int error_count; -__attribute__ ((noclone, noinline)) +__attribute_optimization_barrier__ struct Array allocate (size_t bytes) { @@ -52,7 +52,7 @@ allocate (size_t bytes) return __extension__ (struct Array) {bytes, p}; } -__attribute__ ((noclone, noinline)) +__attribute_optimization_barrier__ void deallocate (struct Array b) { @@ -66,7 +66,7 @@ deallocate (struct Array b) } } -__attribute__ ((noclone, noinline)) +__attribute_optimization_barrier__ void * do_mmap (void *addr, size_t length) { @@ -74,7 +74,7 @@ do_mmap (void *addr, size_t length) MAP_PRIVATE | MAP_ANON, -1, 0); } -__attribute__ ((noclone, noinline)) +__attribute_optimization_barrier__ void * reallocate (struct Array b) { @@ -86,7 +86,7 @@ reallocate (struct Array b) return NULL; } -__attribute__ ((noclone, noinline)) +__attribute_optimization_barrier__ void protect (struct Array b) { @@ -104,7 +104,7 @@ protect (struct Array b) } } -__attribute__ ((noclone, noinline)) +__attribute_optimization_barrier__ ssize_t do_read (int fd, void *ptr, struct Array b) { @@ -116,7 +116,7 @@ do_read (int fd, void *ptr, struct Array b) return 0; } -__attribute__ ((noclone, noinline)) +__attribute_optimization_barrier__ ssize_t do_write (int fd, void *ptr, struct Array b) { diff --git a/nptl/tst-minstack-throw.cc b/nptl/tst-minstack-throw.cc index b729091ec4..ff0d3d39da 100644 --- a/nptl/tst-minstack-throw.cc +++ b/nptl/tst-minstack-throw.cc @@ -24,7 +24,7 @@ #include /* Throw a std::runtime_exception. */ -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void do_throw_exception () { @@ -38,17 +38,17 @@ struct class_with_destructor ~class_with_destructor (); }; -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ class_with_destructor::class_with_destructor () { } -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ class_with_destructor::~class_with_destructor () { } -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void function_with_destructed_object () { diff --git a/nptl/tst-thread-exit-clobber.cc b/nptl/tst-thread-exit-clobber.cc index b3b6989268..9a50848ef8 100644 --- a/nptl/tst-thread-exit-clobber.cc +++ b/nptl/tst-thread-exit-clobber.cc @@ -73,7 +73,7 @@ enum { no_check = -1 }; /* Check that VALUE is the magic value for INDEX, behind a compiler barrier. */ -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void check_magic (int index, unsigned int value) { @@ -103,7 +103,7 @@ check_magic (int index, unsigned int value) /* Check that VALUE is the magic value for INDEX, behind a compiler barrier. Double variant. */ -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void check_magic (int index, double value) { @@ -153,7 +153,7 @@ struct checker call_pthread_exit are used to call pthread_exit indirectly, with the intent of clobbering the register values. */ -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void call_pthread_exit_0 (const values *pvalues) { @@ -166,7 +166,7 @@ call_pthread_exit_0 (const values *pvalues) pthread_exit (NULL); } -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void call_pthread_exit_1 (const values *pvalues) { @@ -180,7 +180,7 @@ call_pthread_exit_1 (const values *pvalues) call_pthread_exit_0 (&other_values); } -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void call_pthread_exit () { @@ -192,7 +192,7 @@ call_pthread_exit () pthread_exit. If Nested is true, call pthread_exit indirectly via call_pthread_exit. */ template -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void * threadfunc (void *closure) { diff --git a/nptl/tst-thread_local1.cc b/nptl/tst-thread_local1.cc index 270520528c..d78ad2731c 100644 --- a/nptl/tst-thread_local1.cc +++ b/nptl/tst-thread_local1.cc @@ -53,27 +53,27 @@ to_string (const counter &c) template struct counting { - counting () __attribute__ ((noinline, noclone)); - ~counting () __attribute__ ((noinline, noclone)); - void operation () __attribute__ ((noinline, noclone)); + counting () __attribute_optimization_barrier__; + ~counting () __attribute_optimization_barrier__; + void operation () __attribute_optimization_barrier__; }; template -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ counting::counting () { ++Counter->constructed; } template -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ counting::~counting () { ++Counter->destructed; } template -void __attribute__ ((noinline, noclone)) +void __attribute_optimization_barrier__ counting::operation () { // Optimization barrier. diff --git a/stdlib/tst-makecontext-align.c b/stdlib/tst-makecontext-align.c index e54b3e1ff2..a2648bf41e 100644 --- a/stdlib/tst-makecontext-align.c +++ b/stdlib/tst-makecontext-align.c @@ -30,7 +30,7 @@ static const char *context; /* Check that ADDRESS is aligned to ALIGNMENT bytes, behind a compiler barrier. */ -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void check_align (void *address, size_t alignment) { @@ -45,7 +45,7 @@ check_align (void *address, size_t alignment) /* Various alignment checking functions. */ -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void check_align_int (void) { @@ -53,7 +53,7 @@ check_align_int (void) check_align (&a, __alignof__ (a)); } -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void check_align_long (void) { @@ -61,7 +61,7 @@ check_align_long (void) check_align (&a, __alignof__ (a)); } -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void check_align_long_long (void) { @@ -69,7 +69,7 @@ check_align_long_long (void) check_align (&a, __alignof__ (a)); } -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void check_align_double (void) { @@ -77,7 +77,7 @@ check_align_double (void) check_align (&a, __alignof__ (a)); } -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void check_align_4 (void) { @@ -85,7 +85,7 @@ check_align_4 (void) check_align (&a, 4); } -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void check_align_8 (void) { @@ -93,7 +93,7 @@ check_align_8 (void) check_align (&a, 8); } -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void check_align_16 (void) { @@ -105,7 +105,7 @@ check_align_16 (void) check_align (&a, 16); } -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void check_align_32 (void) { @@ -120,7 +120,7 @@ check_align_32 (void) } /* Call all the alignment checking functions. */ -__attribute__ ((noinline, noclone, weak)) +__attribute__ ((weak)) __attribute_optimization_barrier__ void check_alignments (void) { diff --git a/stdlib/tst-quick_exit.cc b/stdlib/tst-quick_exit.cc index 4331d80383..1cf2dbfed2 100644 --- a/stdlib/tst-quick_exit.cc +++ b/stdlib/tst-quick_exit.cc @@ -26,7 +26,7 @@ struct A thread_local A a; void -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ optimization_barrier (A &) { } diff --git a/stdlib/tst-setcontext10.c b/stdlib/tst-setcontext10.c index 7267f5efe3..4991d87ebb 100644 --- a/stdlib/tst-setcontext10.c +++ b/stdlib/tst-setcontext10.c @@ -37,7 +37,7 @@ static ucontext_t ctx; static void f2 (void); static void -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ f1 (void) { printf ("start f1\n"); @@ -45,7 +45,7 @@ f1 (void) } static void -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ f2 (void) { printf ("start f2\n"); @@ -64,7 +64,7 @@ f3 (void) } static int -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ do_test_1 (void) { char st1[32768]; diff --git a/stdlib/tst-setcontext11.c b/stdlib/tst-setcontext11.c index 1883c44b76..dbb23640d2 100644 --- a/stdlib/tst-setcontext11.c +++ b/stdlib/tst-setcontext11.c @@ -54,7 +54,7 @@ f1 (int a0, int a1, int a2, int a3) } static void -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ call_longjmp (void) { longjmp_called = 1; diff --git a/stdlib/tst-setcontext5.c b/stdlib/tst-setcontext5.c index 9b29907a13..ad40081852 100644 --- a/stdlib/tst-setcontext5.c +++ b/stdlib/tst-setcontext5.c @@ -27,7 +27,7 @@ static volatile int done; static void f2 (void); static void -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ f1 (void) { printf ("start f1\n"); @@ -35,7 +35,7 @@ f1 (void) } static void -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ f2 (void) { printf ("start f2\n"); diff --git a/stdlib/tst-setcontext8.c b/stdlib/tst-setcontext8.c index cdcf5eb871..72f1c1b2c4 100644 --- a/stdlib/tst-setcontext8.c +++ b/stdlib/tst-setcontext8.c @@ -26,7 +26,7 @@ static ucontext_t ctx[3]; static atomic_int done; static void -__attribute__((noinline, noclone)) +__attribute_optimization_barrier__ f2 (void) { printf ("start f2\n"); diff --git a/stdlib/tst-setcontext9.c b/stdlib/tst-setcontext9.c index 91b6255138..7d2d341fe0 100644 --- a/stdlib/tst-setcontext9.c +++ b/stdlib/tst-setcontext9.c @@ -26,7 +26,7 @@ static ucontext_t ctx[5]; static atomic_int done; static void -__attribute__((noinline, noclone)) +__attribute_optimization_barrier__ f2 (void) { done++; diff --git a/stdlib/tst-swapcontext1.c b/stdlib/tst-swapcontext1.c index c96b8a27a8..8b1590d0fd 100644 --- a/stdlib/tst-swapcontext1.c +++ b/stdlib/tst-swapcontext1.c @@ -29,7 +29,7 @@ const char *fmt2 = "\e[34m"; #define handle_error(msg) \ do { perror(msg); exit(EXIT_FAILURE); } while (0) -__attribute__((noinline, noclone)) +__attribute_optimization_barrier__ static void func4(ucontext_t *uocp, ucontext_t *ucp, const char *str, const char *fmt) { @@ -39,7 +39,7 @@ func4(ucontext_t *uocp, ucontext_t *ucp, const char *str, const char *fmt) printf(" %sfunc4: returning\e[0m\n", fmt); } -__attribute__((noinline, noclone)) +__attribute_optimization_barrier__ static void func3(ucontext_t *uocp, ucontext_t *ucp, const char *str, const char *fmt) { @@ -48,7 +48,7 @@ func3(ucontext_t *uocp, ucontext_t *ucp, const char *str, const char *fmt) printf(" %sfunc3: returning\e[0m\n", fmt); } -__attribute__((noinline, noclone)) +__attribute_optimization_barrier__ static void func1(void) { @@ -59,7 +59,7 @@ func1(void) } } -__attribute__((noinline, noclone)) +__attribute_optimization_barrier__ static void func2(void) { diff --git a/stdlib/tst-swapcontext2.c b/stdlib/tst-swapcontext2.c index a9c1dc827c..f8efdde7e6 100644 --- a/stdlib/tst-swapcontext2.c +++ b/stdlib/tst-swapcontext2.c @@ -32,7 +32,7 @@ static jmp_buf jmpbuf; #define handle_error(msg) \ do { perror(msg); exit(EXIT_FAILURE); } while (0) -__attribute__((noinline, noclone)) +__attribute_optimization_barrier__ static void func4(ucontext_t *uocp, ucontext_t *ucp, const char *str, const char *fmt) { @@ -42,7 +42,7 @@ func4(ucontext_t *uocp, ucontext_t *ucp, const char *str, const char *fmt) printf(" %sfunc4: returning\e[0m\n", fmt); } -__attribute__((noinline, noclone)) +__attribute_optimization_barrier__ static void func3(ucontext_t *uocp, ucontext_t *ucp, const char *str, const char *fmt) { @@ -51,7 +51,7 @@ func3(ucontext_t *uocp, ucontext_t *ucp, const char *str, const char *fmt) printf(" %sfunc3: returning\e[0m\n", fmt); } -__attribute__((noinline, noclone)) +__attribute_optimization_barrier__ static void func1(void) { @@ -67,7 +67,7 @@ func1(void) } } -__attribute__((noinline, noclone)) +__attribute_optimization_barrier__ static void func2(void) { diff --git a/stdlib/tst-thread-quick_exit.cc b/stdlib/tst-thread-quick_exit.cc index dadccee334..66ea855a0d 100644 --- a/stdlib/tst-thread-quick_exit.cc +++ b/stdlib/tst-thread-quick_exit.cc @@ -30,7 +30,7 @@ thread_local A a1; thread_local A a2; void -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ optimization_barrier (A &) { } 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; diff --git a/sysdeps/generic/tst-stack-align.h b/sysdeps/generic/tst-stack-align.h index 12473e32b8..e73acdc29a 100644 --- a/sysdeps/generic/tst-stack-align.h +++ b/sysdeps/generic/tst-stack-align.h @@ -20,7 +20,7 @@ #include int -__attribute__ ((weak, noclone, noinline)) +__attribute__ ((weak)) __attribute_optimization_barrier__ is_aligned (void *p, int align) { return (((uintptr_t) p) & (align - 1)) != 0; diff --git a/sysdeps/unix/sysv/linux/x86_64/tst-cet-property-2.c b/sysdeps/unix/sysv/linux/x86_64/tst-cet-property-2.c index 5274a09509..2b0126bf8e 100644 --- a/sysdeps/unix/sysv/linux/x86_64/tst-cet-property-2.c +++ b/sysdeps/unix/sysv/linux/x86_64/tst-cet-property-2.c @@ -25,7 +25,7 @@ extern void bar (void); void -__attribute__ ((noclone, noinline)) +__attribute_optimization_barrier__ test (void (*func_p) (void)) { func_p (); diff --git a/sysdeps/unix/sysv/linux/x86_64/tst-cet-setcontext-1.c b/sysdeps/unix/sysv/linux/x86_64/tst-cet-setcontext-1.c index 388931f5f3..c9d49bd907 100644 --- a/sysdeps/unix/sysv/linux/x86_64/tst-cet-setcontext-1.c +++ b/sysdeps/unix/sysv/linux/x86_64/tst-cet-setcontext-1.c @@ -30,7 +30,7 @@ static ucontext_t ctx[5]; static atomic_int done; static void -__attribute__((noinline, noclone)) +__attribute_optimization_barrier__ f2 (void) { printf ("start f2\n"); diff --git a/sysdeps/unix/sysv/linux/x86_64/tst-cet-vfork-1.c b/sysdeps/unix/sysv/linux/x86_64/tst-cet-vfork-1.c index 56d77530ae..cf23bd4021 100644 --- a/sysdeps/unix/sysv/linux/x86_64/tst-cet-vfork-1.c +++ b/sysdeps/unix/sysv/linux/x86_64/tst-cet-vfork-1.c @@ -25,7 +25,7 @@ #include #include -__attribute__ ((noclone, noinline)) +__attribute_optimization_barrier__ static void do_test_1 (void) { diff --git a/sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx.c b/sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx.c index ae4dd82556..c3b2afe136 100644 --- a/sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx.c +++ b/sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx.c @@ -27,7 +27,7 @@ extern int arch_prctl (int, ...); #define X86_XSTATE_TILEDATA_ID 18 /* Initialize tile config. */ -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static void init_tile_config (__tilecfg *tileinfo) { diff --git a/sysdeps/x86/tst-ldbl-nonnormal-printf.c b/sysdeps/x86/tst-ldbl-nonnormal-printf.c index 3a60750de4..5869e74994 100644 --- a/sysdeps/x86/tst-ldbl-nonnormal-printf.c +++ b/sysdeps/x86/tst-ldbl-nonnormal-printf.c @@ -23,7 +23,7 @@ /* Fill the stack with non-zero values. This makes a crash in snprintf more likely. */ -static void __attribute__ ((noinline, noclone)) +static void __attribute_optimization_barrier__ fill_stack (void) { char buffer[65536]; diff --git a/sysdeps/x86/tst-memchr-rtm.c b/sysdeps/x86/tst-memchr-rtm.c index 7dc0718b7c..773f972693 100644 --- a/sysdeps/x86/tst-memchr-rtm.c +++ b/sysdeps/x86/tst-memchr-rtm.c @@ -22,7 +22,7 @@ #define STRING_SIZE 1024 char string1[STRING_SIZE]; -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int prepare (void) { @@ -36,7 +36,7 @@ prepare (void) return EXIT_FAILURE; } -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int function (void) { diff --git a/sysdeps/x86/tst-memcmp-rtm.c b/sysdeps/x86/tst-memcmp-rtm.c index 124eb17aed..91920412ed 100644 --- a/sysdeps/x86/tst-memcmp-rtm.c +++ b/sysdeps/x86/tst-memcmp-rtm.c @@ -23,7 +23,7 @@ char string1[STRING_SIZE]; char string2[STRING_SIZE]; -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int prepare (void) { @@ -35,7 +35,7 @@ prepare (void) return EXIT_FAILURE; } -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int function (void) { diff --git a/sysdeps/x86/tst-memmove-rtm.c b/sysdeps/x86/tst-memmove-rtm.c index dfb5533784..ed4bcc1ee7 100644 --- a/sysdeps/x86/tst-memmove-rtm.c +++ b/sysdeps/x86/tst-memmove-rtm.c @@ -23,7 +23,7 @@ char string1[STRING_SIZE]; char string2[STRING_SIZE]; -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int prepare (void) { @@ -35,7 +35,7 @@ prepare (void) return EXIT_FAILURE; } -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int function (void) { diff --git a/sysdeps/x86/tst-memrchr-rtm.c b/sysdeps/x86/tst-memrchr-rtm.c index 48512de7f4..f597081310 100644 --- a/sysdeps/x86/tst-memrchr-rtm.c +++ b/sysdeps/x86/tst-memrchr-rtm.c @@ -22,7 +22,7 @@ #define STRING_SIZE 1024 char string1[STRING_SIZE]; -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int prepare (void) { @@ -36,7 +36,7 @@ prepare (void) return EXIT_FAILURE; } -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int function (void) { diff --git a/sysdeps/x86/tst-memset-rtm.c b/sysdeps/x86/tst-memset-rtm.c index 60e714c757..cf12a2af24 100644 --- a/sysdeps/x86/tst-memset-rtm.c +++ b/sysdeps/x86/tst-memset-rtm.c @@ -22,7 +22,7 @@ #define STRING_SIZE 1024 char string1[STRING_SIZE]; -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int prepare (void) { @@ -30,7 +30,7 @@ prepare (void) return EXIT_SUCCESS; } -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int function (void) { diff --git a/sysdeps/x86/tst-strchr-rtm.c b/sysdeps/x86/tst-strchr-rtm.c index 8294cc5118..c7b020d459 100644 --- a/sysdeps/x86/tst-strchr-rtm.c +++ b/sysdeps/x86/tst-strchr-rtm.c @@ -22,7 +22,7 @@ #define STRING_SIZE 1024 char string1[STRING_SIZE]; -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int prepare (void) { @@ -36,7 +36,7 @@ prepare (void) return EXIT_FAILURE; } -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int function (void) { diff --git a/sysdeps/x86/tst-strcmp-rtm.c b/sysdeps/x86/tst-strcmp-rtm.c index c2274a5d3e..96e19be6c2 100644 --- a/sysdeps/x86/tst-strcmp-rtm.c +++ b/sysdeps/x86/tst-strcmp-rtm.c @@ -40,7 +40,7 @@ CHAR string1[STRING_SIZE]; CHAR string2[STRING_SIZE]; -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int prepare (void) { @@ -52,7 +52,7 @@ prepare (void) return EXIT_FAILURE; } -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int function (void) { diff --git a/sysdeps/x86/tst-strcpy-rtm.c b/sysdeps/x86/tst-strcpy-rtm.c index 139f52004e..15f3419045 100644 --- a/sysdeps/x86/tst-strcpy-rtm.c +++ b/sysdeps/x86/tst-strcpy-rtm.c @@ -23,7 +23,7 @@ char string1[STRING_SIZE]; char string2[STRING_SIZE]; -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int prepare (void) { @@ -35,7 +35,7 @@ prepare (void) return EXIT_FAILURE; } -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int function (void) { diff --git a/sysdeps/x86/tst-strlen-rtm.c b/sysdeps/x86/tst-strlen-rtm.c index 5b083f29dc..0155b68647 100644 --- a/sysdeps/x86/tst-strlen-rtm.c +++ b/sysdeps/x86/tst-strlen-rtm.c @@ -22,7 +22,7 @@ #define STRING_SIZE 1024 char string1[STRING_SIZE]; -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int prepare (void) { @@ -35,7 +35,7 @@ prepare (void) return EXIT_FAILURE; } -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int function (void) { diff --git a/sysdeps/x86/tst-strncmp-rtm.c b/sysdeps/x86/tst-strncmp-rtm.c index ebc8837ad1..bd54c41e77 100644 --- a/sysdeps/x86/tst-strncmp-rtm.c +++ b/sysdeps/x86/tst-strncmp-rtm.c @@ -40,7 +40,7 @@ CHAR string1[STRING_SIZE]; CHAR string2[STRING_SIZE]; -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int prepare (void) { @@ -52,7 +52,7 @@ prepare (void) return EXIT_FAILURE; } -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int function (void) { @@ -62,7 +62,7 @@ function (void) return 1; } -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int function_overflow (void) { @@ -72,7 +72,7 @@ function_overflow (void) return 1; } -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int function_overflow2 (void) { diff --git a/sysdeps/x86/tst-strrchr-rtm.c b/sysdeps/x86/tst-strrchr-rtm.c index 487d2071d4..c7f41427b5 100644 --- a/sysdeps/x86/tst-strrchr-rtm.c +++ b/sysdeps/x86/tst-strrchr-rtm.c @@ -22,7 +22,7 @@ #define STRING_SIZE 1024 char string1[STRING_SIZE]; -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int prepare (void) { @@ -35,7 +35,7 @@ prepare (void) return EXIT_FAILURE; } -__attribute__ ((noinline, noclone)) +__attribute_optimization_barrier__ static int function (void) { diff --git a/sysdeps/x86_64/tst-rsi-strlen.c b/sysdeps/x86_64/tst-rsi-strlen.c index 2c424ffe94..704a2f56a8 100644 --- a/sysdeps/x86_64/tst-rsi-strlen.c +++ b/sysdeps/x86_64/tst-rsi-strlen.c @@ -44,7 +44,7 @@ typedef struct } parameter_t; size_t -__attribute__ ((weak, noinline, noclone)) +__attribute__ ((weak)) __attribute_optimization_barrier__ do_strlen (parameter_t *a, int zero, const CHAR *str) { return CALL (a, str);