* [fixincludes] Fix gcc.dg/pthread-init-[12].c on Solaris 8
@ 2010-07-12 12:10 Rainer Orth
2010-07-12 14:13 ` Bruce Korb
0 siblings, 1 reply; 3+ messages in thread
From: Rainer Orth @ 2010-07-12 12:10 UTC (permalink / raw)
To: gcc-patches; +Cc: Bruce Korb
Two pthread tests fail on Solaris 8:
FAIL: gcc.dg/pthread-init-1.c (test for excess errors)
FAIL: gcc.dg/pthread-init-2.c (test for excess errors)
Excess errors:
In file included from /vol/gcc/src/hg/trunk/solaris/gcc/testsuite/gcc.dg/pthread-init-1.c:14:0:
/vol/gcc/src/hg/trunk/solaris/gcc/testsuite/gcc.dg/pthread-init-common.h:27:3: warning: missing initializer [-Wmissing-field-initializers]
/vol/gcc/src/hg/trunk/solaris/gcc/testsuite/gcc.dg/pthread-init-common.h:27:3: warning: (near initialization for 'pcond.__pthread_cond_flags.__pthread_cond_magic') [-Wmissing-field-initializers]
The problem is that the __pthread_cond_magic field isn't initialized
in PTHREAD_COND_INITIALIZER, while the equivalent field in <synch.h>
DEFAULTCV is. Unfortunately, COND_MAGIC is used there which pollutes
the user namespace, so I'm fixing this by using the value literally.
Since Solaris 9, _COND_MAGIC is used, which lives in <sys/types.h>.
Bootstrapped without regressions on Solaris 8 to 11, both SPARC and
x86. Ok for mainline (and the 4.4 and 4.5 branches once testing
completes there)?
Thanks.
Rainer
2010-06-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* inclhack.def (solaris_cond_init): New fix.
* fixincl.x: Regenerate.
* tests/base/pthread.h [SOLARIS_COND_INIT_CHECK]: New test.
[SOLARIS_MUTEX_INIT_2_CHECK]: Adapt.
diff -r f9ee2257fad3 fixincludes/inclhack.def
--- a/fixincludes/inclhack.def Fri Jul 09 12:30:44 2010 +0200
+++ b/fixincludes/inclhack.def Fri Jul 09 12:36:12 2010 +0200
@@ -3307,6 +3307,26 @@
/*
+ * Solaris 8 PTHREAD_COND_INITIALIZER lacks the __pthread_cond_magic field.
+ * COND_MAGIC is only defined in <synch.h> and pollutes the namespace, so
+ * use the value literally instead.
+ */
+fix = {
+ hackname = solaris_cond_init;
+ select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+ files = pthread.h;
+ mach = '*-*-solaris2.8';
+ c_fix = format;
+ c_fix_arg = "%1, 0x4356%2";
+ c_fix_arg = "^(#define[ \t]+PTHREAD_COND_INITIALIZER[ \t]+"
+ "\\{.*0)(\\},[ \t]*0\\}.*)$";
+ test_text =
+ '#pragma ident "@(#)pthread.h 1.29 01/07/07 SMI"'"\n"
+ '#define PTHREAD_COND_INITIALIZER {{{0}, 0}, 0} /* = DEFAULTCV */';
+};
+
+
+/*
* Sun Solaris 10 defines several C99 math macros in terms of
* builtins specific to the Studio compiler, in particular not
* compatible with the GNU compiler.
diff -r f9ee2257fad3 fixincludes/tests/base/pthread.h
--- a/fixincludes/tests/base/pthread.h Fri Jul 09 12:30:44 2010 +0200
+++ b/fixincludes/tests/base/pthread.h Fri Jul 09 12:36:12 2010 +0200
@@ -101,6 +101,16 @@
#endif /* PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_CHECK */
+#if defined( SOLARIS_COND_INIT_CHECK )
+#pragma ident "@(#)pthread.h 1.29 01/07/07 SMI"
+#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
+#define PTHREAD_COND_INITIALIZER {{{0}, 0, 0x4356}, 0} /* = DEFAULTCV */
+#else
+#define PTHREAD_COND_INITIALIZER {{{0}, 0, 0x4356}, {0}} /* = DEFAULTCV */
+#endif
+#endif /* SOLARIS_COND_INIT_CHECK */
+
+
#if defined( SOLARIS_MUTEX_INIT_2_CHECK )
#ident "@(#)pthread.h 1.26 98/04/12 SMI"
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
@@ -109,9 +119,9 @@
#define PTHREAD_MUTEX_INITIALIZER {{{0},0}, {{{0}}}, {0}}
#endif
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
-#define PTHREAD_COND_INITIALIZER {{{0}, 0}, 0} /* DEFAULTCV */
+#define PTHREAD_COND_INITIALIZER {{{0}, 0, 0x4356}, 0} /* DEFAULTCV */
#else
-#define PTHREAD_COND_INITIALIZER {{{0}, 0}, {0}} /* DEFAULTCV */
+#define PTHREAD_COND_INITIALIZER {{{0}, 0, 0x4356}, {0}} /* DEFAULTCV */
#endif
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
#define PTHREAD_MUTEX_INITIALIZER /* = DEFAULTMUTEX */ \
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [fixincludes] Fix gcc.dg/pthread-init-[12].c on Solaris 8
2010-07-12 12:10 [fixincludes] Fix gcc.dg/pthread-init-[12].c on Solaris 8 Rainer Orth
@ 2010-07-12 14:13 ` Bruce Korb
2010-07-12 14:17 ` Rainer Orth
0 siblings, 1 reply; 3+ messages in thread
From: Bruce Korb @ 2010-07-12 14:13 UTC (permalink / raw)
To: Rainer Orth; +Cc: gcc-patches
This is only now being discovered? :-O !!
OK, looks good to me......
Cheers - Bruce
On Mon, Jul 12, 2010 at 5:09 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> Two pthread tests fail on Solaris 8:
>
> FAIL: gcc.dg/pthread-init-1.c (test for excess errors)
> FAIL: gcc.dg/pthread-init-2.c (test for excess errors)
>
> Excess errors:
> In file included from /vol/gcc/src/hg/trunk/solaris/gcc/testsuite/gcc.dg/pthread-init-1.c:14:0:
> /vol/gcc/src/hg/trunk/solaris/gcc/testsuite/gcc.dg/pthread-init-common.h:27:3: warning: missing initializer [-Wmissing-field-initializers]
> /vol/gcc/src/hg/trunk/solaris/gcc/testsuite/gcc.dg/pthread-init-common.h:27:3: warning: (near initialization for 'pcond.__pthread_cond_flags.__pthread_cond_magic') [-Wmissing-field-initializers]
>
> The problem is that the __pthread_cond_magic field isn't initialized
> in PTHREAD_COND_INITIALIZER,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [fixincludes] Fix gcc.dg/pthread-init-[12].c on Solaris 8
2010-07-12 14:13 ` Bruce Korb
@ 2010-07-12 14:17 ` Rainer Orth
0 siblings, 0 replies; 3+ messages in thread
From: Rainer Orth @ 2010-07-12 14:17 UTC (permalink / raw)
To: Bruce Korb; +Cc: gcc-patches
Bruce Korb <bkorb@gnu.org> writes:
> This is only now being discovered? :-O !!
Strange indeed ;-) I've started my maintenance work at Solaris 11 and
once I got a reasonably clean slate there, started working my way
backwards until Solaris 8. A problem like this is always easier to
analyse and fix than some code generation problem ...
> OK, looks good to me......
Thanks.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-12 14:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-12 12:10 [fixincludes] Fix gcc.dg/pthread-init-[12].c on Solaris 8 Rainer Orth
2010-07-12 14:13 ` Bruce Korb
2010-07-12 14:17 ` Rainer Orth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).