https://gcc.gnu.org/g:b4929ee44647999a3a53180328661ee6cbb9064b

commit b4929ee44647999a3a53180328661ee6cbb9064b
Author: Alexandre Oliva <[email protected]>
Date:   Fri Mar 13 00:30:03 2026 -0300

    testsuite: vxworks: gcov-32 misuses sigjmp_buf with setjmp
    
    The test (presumably by mistake) calls setjmp with a sigjmp_buf.
    
    Because of the sigsetjmp requirement, I'm replacing the setjmp call
    with sigsetjmp, though the comments in the test explicitly mention
    setjmp.
    
    
    for  gcc/testsuite/ChangeLog
    
            * gcc.misc-tests/gcov-32.c: Replace mismatched setjmp call
            with sigsetjmp.

Diff:
---
 gcc/testsuite/gcc.misc-tests/gcov-32.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/gcc.misc-tests/gcov-32.c 
b/gcc/testsuite/gcc.misc-tests/gcov-32.c
index cb8da01b7d5b..1750a0042a40 100644
--- a/gcc/testsuite/gcc.misc-tests/gcov-32.c
+++ b/gcc/testsuite/gcc.misc-tests/gcov-32.c
@@ -9,9 +9,10 @@ typedef void (*sfun) (void);
 extern sfun getfn (int);
 
 /* This distilled srunner setup/teardown functions in check-0.15.2.  The
-   combination of setjmp, optimization, and debug statements causes a problem
-   if the gimple statement iterator is not positioned correctely before adding
-   instrumentation code.  */
+   combination of sigsetjmp, optimization, and debug statements causes a
+   problem if the gimple statement iterator is not positioned correctely before
+   adding instrumentation code.  This was originally setjmp, but a sigjmp_buf
+   can't generally be passed to setjmp.  */
 
 extern void
 debug_after_labels (int *itr)
@@ -19,7 +20,7 @@ debug_after_labels (int *itr)
   for (; *itr; ++itr)
     {
       sfun fn = getfn (*itr);
-      if (setjmp (jmpbuf) == 0)
+      if (sigsetjmp (jmpbuf, 0) == 0)
        fn ();
     }
 }

Reply via email to