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>
This commit is contained in:
Adhemerval Zanella 2024-12-23 05:11:58 +08:00 committed by H.J. Lu
parent 3fb895ac88
commit a2b0ff98a0
45 changed files with 112 additions and 101 deletions

View File

@ -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)
{

View File

@ -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;

View File

@ -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)
{

View File

@ -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

View File

@ -21,7 +21,7 @@
#include <signal.h>
static void
__attribute__ ((noinline, noclone))
__attribute_optimization_barrier__
test (char *foo)
{
int i;

View File

@ -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;

View File

@ -16,15 +16,17 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#include <sys/cdefs.h>
/* 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)

View File

@ -16,6 +16,8 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#include <sys/cdefs.h>
/* 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)

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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 ()
{

View File

@ -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<unsigned int> *pvalues)
{
@ -166,7 +166,7 @@ call_pthread_exit_0 (const values<unsigned int> *pvalues)
pthread_exit (NULL);
}
__attribute__ ((noinline, noclone, weak))
__attribute__ ((weak)) __attribute_optimization_barrier__
void
call_pthread_exit_1 (const values<double> *pvalues)
{
@ -180,7 +180,7 @@ call_pthread_exit_1 (const values<double> *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 <class T, bool Nested>
__attribute__ ((noinline, noclone, weak))
__attribute__ ((weak)) __attribute_optimization_barrier__
void *
threadfunc (void *closure)
{

View File

@ -53,27 +53,27 @@ to_string (const counter &c)
template <counter *Counter>
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<counter *Counter>
__attribute__ ((noinline, noclone))
__attribute_optimization_barrier__
counting<Counter>::counting ()
{
++Counter->constructed;
}
template<counter *Counter>
__attribute__ ((noinline, noclone))
__attribute_optimization_barrier__
counting<Counter>::~counting ()
{
++Counter->destructed;
}
template<counter *Counter>
void __attribute__ ((noinline, noclone))
void __attribute_optimization_barrier__
counting<Counter>::operation ()
{
// Optimization barrier.

View File

@ -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)
{

View File

@ -26,7 +26,7 @@ struct A
thread_local A a;
void
__attribute__ ((noinline, noclone))
__attribute_optimization_barrier__
optimization_barrier (A &)
{
}

View File

@ -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];

View File

@ -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;

View File

@ -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");

View File

@ -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");

View File

@ -26,7 +26,7 @@ static ucontext_t ctx[5];
static atomic_int done;
static void
__attribute__((noinline, noclone))
__attribute_optimization_barrier__
f2 (void)
{
done++;

View File

@ -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)
{

View File

@ -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)
{

View File

@ -30,7 +30,7 @@ thread_local A a1;
thread_local A a2;
void
__attribute__ ((noinline, noclone))
__attribute_optimization_barrier__
optimization_barrier (A &)
{
}

View File

@ -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;

View File

@ -20,7 +20,7 @@
#include <stdint.h>
int
__attribute__ ((weak, noclone, noinline))
__attribute__ ((weak)) __attribute_optimization_barrier__
is_aligned (void *p, int align)
{
return (((uintptr_t) p) & (align - 1)) != 0;

View File

@ -25,7 +25,7 @@
extern void bar (void);
void
__attribute__ ((noclone, noinline))
__attribute_optimization_barrier__
test (void (*func_p) (void))
{
func_p ();

View File

@ -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");

View File

@ -25,7 +25,7 @@
#include <x86intrin.h>
#include <support/test-driver.h>
__attribute__ ((noclone, noinline))
__attribute_optimization_barrier__
static void
do_test_1 (void)
{

View File

@ -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)
{

View File

@ -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];

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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);