]> Savannah Git Hosting - gnulib.git/commitdiff
memset_explicit, explicit_bzero tests: Fix test failures with new gcc.
authorBruno Haible <bruno@clisp.org>
Mon, 23 Oct 2023 00:04:03 +0000 (02:04 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 5 Nov 2023 19:19:09 +0000 (20:19 +0100)
Reported by Sam James <sam@gentoo.org> in
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111904>.

Fix by Alexandre Oliva <aoliva@gcc.gnu.org>.

* tests/test-memset_explicit.c (do_secret_stuff): Declare with
attributes 'noclone' and 'noipa'.
* tests/test-explicit_bzero.c (do_secret_stuff): Likewise.

ChangeLog
tests/test-explicit_bzero.c
tests/test-memset_explicit.c

index f45d0a5839e7f15c69b37fe21399aaa6d9258b57..b61d1b07df8c9bc3851ed1c742bac6d50079f6f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2023-10-22  Bruno Haible  <bruno@clisp.org>
+
+       memset_explicit, explicit_bzero tests: Fix test failures with new gcc.
+       Reported by Sam James <sam@gentoo.org> in
+       <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111904>.
+       Fix by Alexandre Oliva <aoliva@gcc.gnu.org>.
+       * 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  <bruno@clisp.org>
 
        net_if tests: Fix gcc warning.
index 9754750e133dba8810f547724c8d0aeed2930825..f29f0ea0dacb3c15e1817138c2c806ff8bcc3194 100644 (file)
@@ -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];
index b36a7cfe76b9c09bd9f62d7897787bb85a42ad78..cdc7fc30b2a2cefb3b5d7270369005b74bfa5a0e 100644 (file)
@@ -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];