From: John David Anglin Date: Sun, 15 Oct 2006 22:58:29 +0000 (+0000) Subject: re PR target/29300 (FAIL: gcc.dg/pthread-init-[12].c (test for excess errors)) X-Git-Tag: releases/gcc-4.0.4~283 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e035d2a3108287016a16387f0bdb408c4b1ee7c1;p=thirdparty%2Fgcc.git re PR target/29300 (FAIL: gcc.dg/pthread-init-[12].c (test for excess errors)) PR target/29300 * inclhack.def (hpux_pthread_initializers): New hack. * tests/base/sys/pthread.h: New file. * fixincl.x: Regenerate. From-SVN: r117755 --- diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index b0b2cffb354a..44926503e6d4 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,11 @@ +2006-10-15 John David Anglin + + PR target/29300 + * inclhack.def (hpux_pthread_initializers): New hack. + * tests/base/sys/pthread.h: New file. + + * fixincl.x: Regenerate. + 2006-10-03 Uros Bizjak * inclhack.def (glibc_mutex_init): Also fix diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index 621ed2043683..cc71e828aa8a 100644 --- a/fixincludes/fixincl.x +++ b/fixincludes/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed Tuesday October 3, 2006 at 08:25:47 AM CEST + * It has been AutoGen-ed Sunday October 15, 2006 at 06:57:07 PM EDT * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT CVS-MERGE THIS FILE, EITHER Tue Oct 3 08:25:47 CEST 2006 +/* DO NOT CVS-MERGE THIS FILE, EITHER Sun Oct 15 18:57:08 EDT 2006 * * You must regenerate it. Use the ./genfixes script. * @@ -15,7 +15,7 @@ * certain ANSI-incompatible system header files which are fixed to work * correctly with ANSI C and placed in a directory that GNU C will search. * - * This file contains 196 fixup descriptions. + * This file contains 197 fixup descriptions. * * See README for more information. * @@ -3111,6 +3111,46 @@ static const char* apzIp_Missing_SemiPatch[] = { "sed", "-e", "/^struct/,/^};/s/}$/};/", (char*)NULL }; +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Hpux_Pthread_Initializers fix + */ +tSCC zHpux_Pthread_InitializersName[] = + "hpux_pthread_initializers"; + +/* + * File name selection pattern + */ +tSCC zHpux_Pthread_InitializersList[] = + "|sys/pthread.h|"; +/* + * Machine/OS name selection pattern + */ +tSCC* apzHpux_Pthread_InitializersMachs[] = { + "*-hp-hpux11.[0-3]*", + (const char*)NULL }; +#define HPUX_PTHREAD_INITIALIZERS_TEST_CT 0 +#define aHpux_Pthread_InitializersTests (tTestDesc*)NULL + +/* + * Fix Command Arguments for Hpux_Pthread_Initializers + */ +static const char* apzHpux_Pthread_InitializersPatch[] = { "sed", + "-e", "s@^[ \t]*1, 1, 1, 1,[ \t]*\\\\@\t{ 1, 1, 1, 1 },\t\t\t\t\t\t\t\\\\@", + "-e", "s@^[ \t]*1,[ \t]*\\\\@\t{ 1, 0 }@", + "-e", "/^[ \t]*0$/d", + "-e", "s@__PTHREAD_MUTEX_VALID, 0@{ __PTHREAD_MUTEX_VALID, 0 }@", + "-e", "s@^[ \t]*0, 0, -1, 0,[ \t]*\\\\@\t{ 0, 0, -1, 0 },\t\t\t\t\t\t\\\\@", + "-e", "s@0, __LWP_MTX_VALID, 0, 1, 1, 1, 1,[ \t]*\\\\@{ 0, __LWP_MTX_VALID }, { 0, 1, 1, 1, 1 },\t\t\t\\\\@", + "-e", "s@^[ \t]*__LWP_MTX_VALID, 0, 1, 1, 1, 1,[ \t]*\\\\@\t{ 0, __LWP_MTX_VALID }, { 0, 1, 1, 1, 1 },\t\t\t\\\\@", + "-e", "s@^[ \t]*0, 0[ \t]*\\\\@\t{ 0, 0 }\t\t\t\t\t\t\t\\\\@", + "-e", "s@__PTHREAD_COND_VALID, 0@{ __PTHREAD_COND_VALID, 0 }@", + "-e", "s@__LWP_COND_VALID, 0,[ \t]*\\\\@{ __LWP_COND_VALID, 0 },\t\t\t\t\t\\\\@", + "-e", "s@__PTHREAD_RWLOCK_VALID, 0@{ __PTHREAD_RWLOCK_VALID, 0 }@", + "-e", "s@__LWP_RWLOCK_VALID, 0,[ \t]*\\\\@{ __LWP_RWLOCK_VALID, 0 },\t\t\t\t\t\\\\@", + "-e", "s@^[ \t]*0, 0, 0, 0, 0, 0, 0[ \t]*\\\\@\t{ 0, 0, 0, 0, 0 }, { 0, 0}\t\t\t\t\t\\\\@", + (char*)NULL }; + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * Description of Irix___Restrict fix @@ -7907,7 +7947,7 @@ static const char* apzX11_SprintfPatch[] = { */ #define REGEX_COUNT 238 #define MACH_LIST_SIZE_LIMIT 261 -#define FIX_COUNT 196 +#define FIX_COUNT 197 /* * Enumerate the fixes @@ -7988,6 +8028,7 @@ typedef enum { IO_QUOTES_DEF_FIXIDX, IO_QUOTES_USE_FIXIDX, IP_MISSING_SEMI_FIXIDX, + HPUX_PTHREAD_INITIALIZERS_FIXIDX, IRIX___RESTRICT_FIXIDX, IRIX___GENERIC1_FIXIDX, IRIX___GENERIC2_FIXIDX, @@ -8487,6 +8528,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { IP_MISSING_SEMI_TEST_CT, FD_MACH_ONLY, aIp_Missing_SemiTests, apzIp_Missing_SemiPatch, 0 }, + { zHpux_Pthread_InitializersName, zHpux_Pthread_InitializersList, + apzHpux_Pthread_InitializersMachs, + HPUX_PTHREAD_INITIALIZERS_TEST_CT, FD_MACH_ONLY, + aHpux_Pthread_InitializersTests, apzHpux_Pthread_InitializersPatch, 0 }, + { zIrix___RestrictName, zIrix___RestrictList, apzIrix___RestrictMachs, IRIX___RESTRICT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 50f036725bca..cabdc22491f9 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -1777,6 +1777,47 @@ fix = { "}; /* mumbled struct */\n"; }; +/* + * Add missing braces to pthread initializer defines. + */ +fix = { + hackname = hpux_pthread_initializers; + mach = "*-hp-hpux11.[0-3]*"; + files = sys/pthread.h; + sed = "s@^[ \t]*1, 1, 1, 1,[ \t]*\\\\" + "@\t{ 1, 1, 1, 1 },\t\t\t\t\t\t\t\\\\@"; + sed = "s@^[ \t]*1,[ \t]*\\\\" + "@\t{ 1, 0 }@"; + sed = "/^[ \t]*0$/d"; + sed = "s@__PTHREAD_MUTEX_VALID, 0" + "@{ __PTHREAD_MUTEX_VALID, 0 }@"; + sed = "s@^[ \t]*0, 0, -1, 0,[ \t]*\\\\" + "@\t{ 0, 0, -1, 0 },\t\t\t\t\t\t\\\\@"; + sed = "s@0, __LWP_MTX_VALID, 0, 1, 1, 1, 1,[ \t]*\\\\" + "@{ 0, __LWP_MTX_VALID }, { 0, 1, 1, 1, 1 },\t\t\t\\\\@"; + sed = "s@^[ \t]*__LWP_MTX_VALID, 0, 1, 1, 1, 1,[ \t]*\\\\" + "@\t{ 0, __LWP_MTX_VALID }, { 0, 1, 1, 1, 1 },\t\t\t\\\\@"; + sed = "s@^[ \t]*0, 0[ \t]*\\\\" + "@\t{ 0, 0 }\t\t\t\t\t\t\t\\\\@"; + sed = "s@__PTHREAD_COND_VALID, 0" + "@{ __PTHREAD_COND_VALID, 0 }@"; + sed = "s@__LWP_COND_VALID, 0,[ \t]*\\\\" + "@{ __LWP_COND_VALID, 0 },\t\t\t\t\t\\\\@"; + sed = "s@__PTHREAD_RWLOCK_VALID, 0" + "@{ __PTHREAD_RWLOCK_VALID, 0 }@"; + sed = "s@__LWP_RWLOCK_VALID, 0,[ \t]*\\\\" + "@{ __LWP_RWLOCK_VALID, 0 },\t\t\t\t\t\\\\@"; + sed = "s@^[ \t]*0, 0, 0, 0, 0, 0, 0[ \t]*\\\\" + "@\t{ 0, 0, 0, 0, 0 }, { 0, 0}\t\t\t\t\t\\\\@"; + test_text = "#define PTHREAD_MUTEX_INITIALIZER {\t\t\t\t\t\\\\\n" + "\t__PTHREAD_MUTEX_VALID, 0,\t\t\t\t\t\\\\\n" + "\t(PTHREAD_MUTEX_DEFAULT | PTHREAD_PROCESS_PRIVATE),\t\t\\\\\n" + "\t__SPNLCK_INITIALIZER,\t\t\t\t\t\t\\\\\n" + "\t0, 0, -1, 0,\t\t\t\t\t\t\t\\\\\n" + "\t0, __LWP_MTX_VALID, 0, 1, 1, 1, 1,\t\t\t\t\\\\\n" + "\t0, 0\t\t\t\t\t\t\t\t\\\\\n" + "}\n"; +}; /* * IRIX 6.5.1[89] unconditionally defines diff --git a/fixincludes/tests/base/sys/pthread.h b/fixincludes/tests/base/sys/pthread.h new file mode 100644 index 000000000000..9948288d92a8 --- /dev/null +++ b/fixincludes/tests/base/sys/pthread.h @@ -0,0 +1,22 @@ +/* DO NOT EDIT THIS FILE. + + It has been auto-edited by fixincludes from: + + "fixinc/tests/inc/sys/pthread.h" + + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + + + +#if defined( HPUX_PTHREAD_INITIALIZERS_CHECK ) +#define PTHREAD_MUTEX_INITIALIZER { \ + { __PTHREAD_MUTEX_VALID, 0 }, \ + (PTHREAD_MUTEX_DEFAULT | PTHREAD_PROCESS_PRIVATE), \ + __SPNLCK_INITIALIZER, \ + { 0, 0, -1, 0 }, \ + { 0, __LWP_MTX_VALID }, { 0, 1, 1, 1, 1 }, \ + { 0, 0 } \ +} + +#endif /* HPUX_PTHREAD_INITIALIZERS_CHECK */