From: Bruno Haible Date: Mon, 23 Oct 2023 00:04:03 +0000 (+0200) Subject: memset_explicit, explicit_bzero tests: Fix test failures with new gcc. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=ade684c3b3b8d39e4ee5b3ed49d50687c089b50f;p=gnulib.git memset_explicit, explicit_bzero tests: Fix test failures with new gcc. Reported by Sam James in . Fix by Alexandre Oliva . * tests/test-memset_explicit.c (do_secret_stuff): Declare with attributes 'noclone' and 'noipa'. * tests/test-explicit_bzero.c (do_secret_stuff): Likewise. --- diff --git a/ChangeLog b/ChangeLog index f45d0a5839..b61d1b07df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2023-10-22 Bruno Haible + + memset_explicit, explicit_bzero tests: Fix test failures with new gcc. + Reported by Sam James in + . + Fix by Alexandre Oliva . + * tests/test-memset_explicit.c (do_secret_stuff): Declare with + attributes 'noclone' and 'noipa'. + * tests/test-explicit_bzero.c (do_secret_stuff): Likewise. + 2023-10-15 Bruno Haible net_if tests: Fix gcc warning. diff --git a/tests/test-explicit_bzero.c b/tests/test-explicit_bzero.c index 9754750e13..f29f0ea0da 100644 --- a/tests/test-explicit_bzero.c +++ b/tests/test-explicit_bzero.c @@ -133,6 +133,12 @@ test_heap (void) does not eliminate a call to explicit_bzero, even if data flow analysis reveals that the stack area is dead at the end of the function. */ static bool _GL_ATTRIBUTE_NOINLINE +#if __GNUC__ + (__GNUC_MINOR__ >= 5) > 4 +__attribute__ ((__noclone__)) +#endif +#if __GNUC__ >= 8 +__attribute__ ((__noipa__)) +#endif do_secret_stuff (int volatile pass, char *volatile *volatile last_stackbuf) { char stackbuf[SECRET_SIZE]; diff --git a/tests/test-memset_explicit.c b/tests/test-memset_explicit.c index b36a7cfe76..cdc7fc30b2 100644 --- a/tests/test-memset_explicit.c +++ b/tests/test-memset_explicit.c @@ -143,6 +143,12 @@ test_heap (void) does not eliminate a call to memset_explicit, even if data flow analysis reveals that the stack area is dead at the end of the function. */ static bool _GL_ATTRIBUTE_NOINLINE +#if __GNUC__ + (__GNUC_MINOR__ >= 5) > 4 +__attribute__ ((__noclone__)) +#endif +#if __GNUC__ >= 8 +__attribute__ ((__noipa__)) +#endif do_secret_stuff (int volatile pass, char *volatile *volatile last_stackbuf) { char stackbuf[SECRET_SIZE];