[Patch][BZ 14583] Fix prototype of sigsetjmp in pthread.h

Jeff Law law@redhat.com
Fri Sep 14 17:30:00 GMT 2012


pthread.h declares __sigsetjmp as:

extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) 
__THROW;

The problem is __sigsetjmp needs to be marked as non-leaf as is the case 
in setjmp.h:

extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask)
__THROWNL;

Failure to mark __sigsetjmp correctly can result in GCC eliminating 
stores that are not dead.  See:

https://bugzilla.redhat.com/show_bug.cgi?id=857236

Attached is the obvious fix to pthread.h.  However, one could ask the 
question should pthread provide a prototype for sigsetjmp at all.  If 
you prefer to see the prototype be removed, I'm certainly willing to do 
that too.



-------------- next part --------------
2012-09-14  Jeff Law  <law@redhat.com>

	[BZ #14583]
	* sysdeps/pthread/pthread.h: Fix prototype of __sigsetjmp.

diff --git a/NEWS b/NEWS
index d27de18..c0ef036 100644
--- a/NEWS
+++ b/NEWS
@@ -13,7 +13,7 @@ Version 2.17
   13542, 13717, 13696, 13939, 13966, 14042, 14090, 14166, 14150, 14151,
   14154, 14157, 14166, 14173, 14195, 14237, 14252, 14283, 14298, 14303,
   14307, 14328, 14331, 14336, 14337, 14347, 14349, 14459, 14476, 14505,
-  14510, 14516, 14518, 14519, 14532, 14538, 14544, 14545, 14576,
+  14510, 14516, 14518, 14519, 14532, 14538, 14544, 14545, 14576, 14583
 
 * Support for STT_GNU_IFUNC symbols added for s390 and s390x.
   Optimized versions of memcpy, memset, and memcmp added for System z10 and
diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h
index 246c1a0..2ad7351 100644
--- a/nptl/sysdeps/pthread/pthread.h
+++ b/nptl/sysdeps/pthread/pthread.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2011, 2012 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -731,7 +731,7 @@ extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
 
 /* Function used in the macros.  */
 struct __jmp_buf_tag;
-extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROW;
+extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL;
 
 
 /* Mutex handling.  */


More information about the Libc-alpha mailing list