aboutsummaryrefslogtreecommitdiff
path: root/nptl/tst-minstack-throw.cc
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-12-23 05:11:58 +0800
committerH.J. Lu <hjl.tools@gmail.com>2024-12-23 06:28:55 +0800
commita2b0ff98a0d44259cc5f6bd7d3a3676ae9f8996a (patch)
tree7816983cdeea6e6c32dd005c76da785811ea3047 /nptl/tst-minstack-throw.cc
parent3fb895ac88e99201573352b1abc18db4340ecede (diff)
downloadglibc-a2b0ff98a0d44259cc5f6bd7d3a3676ae9f8996a.tar.xz
glibc-a2b0ff98a0d44259cc5f6bd7d3a3676ae9f8996a.zip
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 <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'nptl/tst-minstack-throw.cc')
-rw-r--r--nptl/tst-minstack-throw.cc8
1 files changed, 4 insertions, 4 deletions
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 <support/xthread.h>
/* 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 ()
{