The alloca.h header on hppa-hpux needs to include sys/stdsyms.h to define _PROTOTYPES, etc. It was assumed that stddef.h would include sys/stdsyms.h. However, the HP version of stddef.h is now replaced by a GCC version and it doesn't include sys/stdsyms.h.
The attached change modifies alloca.h to explicitly include sys/stdsyms.h if it hasn't been included previously. This fixes the libgomp.oacc-c-c++-common/loop-dim-default.c test case. Tested on hppa64-hp-hpux11.11. Committed to trunk. Dave -- John David Anglin dave.ang...@bell.net
2017-02-11 John David Anglin <dang...@gcc.gnu.org> * tests/base/alloca.h: New file. * inclhack.def (hppa_hpux11_alloca): New fix. * fixincl.x: Regenerate. --- /dev/null 2017-02-10 13:37:33 +0000 +++ tests/base/alloca.h 2017-02-10 13:32:02 +0000 @@ -0,0 +1,18 @@ +/* DO NOT EDIT THIS FILE. + + It has been auto-edited by fixincludes from: + + "fixinc/tests/inc/alloca.h" + + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + + + +#if defined( HPPA_HPUX11_ALLOCA_CHECK ) +#ifndef _SYS_STDSYMS_INCLUDED +# include <sys/stdsyms.h> +#endif /* _SYS_STDSYMS_INCLUDED */ + +#ifndef _STDDEF_INCLUDED +#endif /* HPPA_HPUX11_ALLOCA_CHECK */ Index: inclhack.def =================================================================== --- inclhack.def (revision 245313) +++ inclhack.def (working copy) @@ -2275,6 +2275,24 @@ }; /* + * The HP-UX stddef.h is replaced by gcc's. It doesn't include sys/stdsyms.h. + * As a result, we need to include sys/stdsyms.h in alloca.h. + */ +fix = { + hackname = hppa_hpux11_alloca; + mach = "hppa*-*-hpux11*"; + files = alloca.h; + select = "#ifndef _STDDEF_INCLUDED"; + c_fix = format; + c_fix_arg = "#ifndef _SYS_STDSYMS_INCLUDED\n" + "# include <sys/stdsyms.h>\n" + "#endif /* _SYS_STDSYMS_INCLUDED */\n\n" + "%0"; + + test_text = "#ifndef _STDDEF_INCLUDED"; +}; + +/* * Make sure hpux defines abs in header. */ fix = {