From 5b6d07c4c4862c60dca5affaeaa4def15139b295 Mon Sep 17 00:00:00 2001 From: danglin Date: Sun, 22 Sep 2002 19:23:20 +0000 Subject: [PATCH] * c-common.c (preprocessing_trad_p): Define. * pa-hiux.h, pa-hpux.h, pa-hpux7.h (CPP_PREDEFINES): Delete. (TARGET_OS_CPP_BUILTINS, SUBTARGET_SWITCHES): Define. * pa-hpux10.h (TARGET_OS_CPP_BUILTINS, CPP_SPEC): Define. * pa-hpux11.h (TARGET_OS_CPP_BUILTINS): Define. * pa-linux.h (CPP_PREDEFINES): Delete. (TARGET_OS_CPP_BUILTINS, CPP_SPEC): Define. * pa32-linux.h, pa64-linux.h (CPP_SPEC): Delete. * pa-osf.h, pa-pro-end.h, rtems.h (CPP_PREDEFINES): Delete. (TARGET_OS_CPP_BUILTINS): Define. * pa.h (MASK_SIO, TARGET_SIO, TARGET_PA_10): Define. (TARGET_SWITCHES): Reformat. Use N_() macro. Add SUBTARGET_SWITCHES. (SUBTARGET_SWITCHES): Provide default definition. (TARGET_OPTIONS): Reformat. Use N_() macro. (CPP_PA10_SPEC, CPP_PA11_SPEC, CPP_PA20_SPEC, CPP_64BIT_SPEC, CPP_CPU_DEFAULT_SPEC, CPP_64BIT_DEFAULT_SPEC, SUBTARGET_EXTRA_SPECS, EXTRA_SPECS, CPP_SPEC, CPLUSPLUS_CPP_SPEC, CPP_PREDEFINES): Delete. (TARGET_CPU_CPP_BUILTINS): Define. (TARGET_OS_CPP_BUILTINS): Define for BSD-like systems. * doc/invoke.texi (msio, mwsio): Document new hppa options. * doc/tm.texi (TARGET_CPU_CPP_BUILTINS): Document macro preprocessing_trad_p(). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57416 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 25 +++++ gcc/c-common.c | 1 + gcc/config/pa/pa-hiux.h | 58 ++++++++++- gcc/config/pa/pa-hpux.h | 57 ++++++++++- gcc/config/pa/pa-hpux10.h | 51 +++++++++- gcc/config/pa/pa-hpux11.h | 53 ++++++++++- gcc/config/pa/pa-hpux7.h | 57 ++++++++++- gcc/config/pa/pa-linux.h | 18 +++- gcc/config/pa/pa-osf.h | 36 +++++-- gcc/config/pa/pa-pro-end.h | 20 +++- gcc/config/pa/pa.h | 233 +++++++++++++++++++++++---------------------- gcc/config/pa/pa32-linux.h | 3 - gcc/config/pa/pa64-linux.h | 5 +- gcc/config/pa/rtems.h | 17 +++- gcc/doc/invoke.texi | 17 +++- gcc/doc/tm.texi | 4 +- 16 files changed, 497 insertions(+), 158 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 051b3c3d919..df74a29a637 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,28 @@ +2002-09-22 John David Anglin + + * c-common.c (preprocessing_trad_p): Define. + * pa-hiux.h, pa-hpux.h, pa-hpux7.h (CPP_PREDEFINES): Delete. + (TARGET_OS_CPP_BUILTINS, SUBTARGET_SWITCHES): Define. + * pa-hpux10.h (TARGET_OS_CPP_BUILTINS, CPP_SPEC): Define. + * pa-hpux11.h (TARGET_OS_CPP_BUILTINS): Define. + * pa-linux.h (CPP_PREDEFINES): Delete. + (TARGET_OS_CPP_BUILTINS, CPP_SPEC): Define. + * pa32-linux.h, pa64-linux.h (CPP_SPEC): Delete. + * pa-osf.h, pa-pro-end.h, rtems.h (CPP_PREDEFINES): Delete. + (TARGET_OS_CPP_BUILTINS): Define. + * pa.h (MASK_SIO, TARGET_SIO, TARGET_PA_10): Define. + (TARGET_SWITCHES): Reformat. Use N_() macro. Add SUBTARGET_SWITCHES. + (SUBTARGET_SWITCHES): Provide default definition. + (TARGET_OPTIONS): Reformat. Use N_() macro. + (CPP_PA10_SPEC, CPP_PA11_SPEC, CPP_PA20_SPEC, CPP_64BIT_SPEC, + CPP_CPU_DEFAULT_SPEC, CPP_64BIT_DEFAULT_SPEC, SUBTARGET_EXTRA_SPECS, + EXTRA_SPECS, CPP_SPEC, CPLUSPLUS_CPP_SPEC, CPP_PREDEFINES): Delete. + (TARGET_CPU_CPP_BUILTINS): Define. + (TARGET_OS_CPP_BUILTINS): Define for BSD-like systems. + * doc/invoke.texi (msio, mwsio): Document new hppa options. + * doc/tm.texi (TARGET_CPU_CPP_BUILTINS): Document macro + preprocessing_trad_p(). + 2002-09-22 Jason Thorpe * doc/install.texi: Document behavior of --with-headers and diff --git a/gcc/c-common.c b/gcc/c-common.c index 62458d66ff1..c85c23c8eca 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -5007,6 +5007,7 @@ cb_register_builtins (pfile) /* A straightforward target hook doesn't work, because of problems linking that hook's body when part of non-C front ends. */ # define preprocessing_asm_p() (cpp_get_options (pfile)->lang == CLK_ASM) +# define preprocessing_trad_p() (cpp_get_options (pfile)->traditional) # define builtin_define(TXT) cpp_define (pfile, TXT) # define builtin_assert(TXT) cpp_assert (pfile, TXT) TARGET_CPU_CPP_BUILTINS (); diff --git a/gcc/config/pa/pa-hiux.h b/gcc/config/pa/pa-hiux.h index aed3ca3214c..c1d945c6daa 100644 --- a/gcc/config/pa/pa-hiux.h +++ b/gcc/config/pa/pa-hiux.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for HI-UX. - Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1993, 1995, 1996, 2002 Free Software Foundation, Inc. This file is part of GNU CC. @@ -21,6 +21,56 @@ Boston, MA 02111-1307, USA. */ /* HIUX is just a HPUX variant. We can simply use the HPUX configuration for just about everything. */ -/* Predefines are the one noteworthy difference between HPUX and HIUX. */ -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dhppa -DPWB -Dunix -D__H3050R -D__H3050RX -Asystem=unix -Asystem=hiux -Acpu=hppa -Amachine=hppa" +/* OS cpp builtins are the one noteworthy difference between HPUX and HIUX. + The following defines are similar to those for hpux10 with the addition + of __H3050R and __H3050RX. */ +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_assert ("system=hiux"); \ + builtin_assert ("system=unix"); \ + builtin_define ("__hp9000s800"); \ + builtin_define ("__hp9000s800__"); \ + builtin_define ("__hiux"); \ + builtin_define ("__hiux__"); \ + builtin_define ("__unix"); \ + builtin_define ("__unix__"); \ + builtin_define ("__H3050R"); \ + builtin_define ("__H3050RX"); \ + if (c_language == clk_cplusplus) \ + { \ + builtin_define ("_HIUX_SOURCE"); \ + builtin_define ("_INCLUDE_LONGLONG"); \ + } \ + else if (!flag_iso) \ + { \ + builtin_define ("_HIUX_SOURCE"); \ + if (preprocessing_trad_p ()) \ + { \ + builtin_define ("hp9000s800"); \ + builtin_define ("hppa"); \ + builtin_define ("hiux"); \ + builtin_define ("unix"); \ + builtin_define ("__CLASSIC_C__"); \ + builtin_define ("_PWB"); \ + builtin_define ("PWB"); \ + } \ + else \ + builtin_define ("__STDC_EXT__"); \ + } \ + if (TARGET_SIO) \ + builtin_define ("_SIO"); \ + else \ + { \ + builtin_define ("__hp9000s700"); \ + builtin_define ("__hp9000s700__"); \ + builtin_define ("_WSIO"); \ + } \ + } \ + while (0) + +#undef SUBTARGET_SWITCHES +#define SUBTARGET_SWITCHES \ + { "sio", MASK_SIO, N_("Generate cpp defines for server IO") }, \ + { "wsio", -MASK_SIO, N_("Generate cpp defines for workstation IO") }, diff --git a/gcc/config/pa/pa-hpux.h b/gcc/config/pa/pa-hpux.h index e541a97da6d..b9d563e09be 100644 --- a/gcc/config/pa/pa-hpux.h +++ b/gcc/config/pa/pa-hpux.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for HP-UX. - Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1991, 1995, 1996, 2002 Free Software Foundation, Inc. This file is part of GNU CC. @@ -28,13 +28,62 @@ Boston, MA 02111-1307, USA. */ #define SIZE_TYPE "unsigned int" #define PTRDIFF_TYPE "int" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_assert ("system=hpux"); \ + builtin_assert ("system=unix"); \ + builtin_define ("__hp9000s800"); \ + builtin_define ("__hp9000s800__"); \ + builtin_define ("__hp9k8"); \ + builtin_define ("__hp9k8__"); \ + builtin_define ("__hpux"); \ + builtin_define ("__hpux__"); \ + builtin_define ("__unix"); \ + builtin_define ("__unix__"); \ + if (c_language == clk_cplusplus) \ + { \ + builtin_define ("_HPUX_SOURCE"); \ + builtin_define ("_INCLUDE_LONGLONG"); \ + } \ + else if (!flag_iso) \ + { \ + builtin_define ("_HPUX_SOURCE"); \ + if (preprocessing_trad_p ()) \ + { \ + builtin_define ("hp9000s800"); \ + builtin_define ("hp9k8"); \ + builtin_define ("hppa"); \ + builtin_define ("hpux"); \ + builtin_define ("unix"); \ + builtin_define ("__CLASSIC_C__"); \ + builtin_define ("_PWB"); \ + builtin_define ("PWB"); \ + } \ + else \ + builtin_define ("__STDC_EXT__"); \ + } \ + if (TARGET_SIO) \ + builtin_define ("_SIO"); \ + else \ + { \ + builtin_define ("__hp9000s700"); \ + builtin_define ("__hp9000s700__"); \ + builtin_define ("_WSIO"); \ + } \ + } \ + while (0) + +#undef SUBTARGET_SWITCHES +#define SUBTARGET_SWITCHES \ + { "sio", MASK_SIO, N_("Generate cpp defines for server IO") }, \ + { "wsio", -MASK_SIO, N_("Generate cpp defines for workstation IO") }, + /* Like the default, except no -lg. */ #undef LIB_SPEC #define LIB_SPEC "%{!shared:%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}}" -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -Asystem=unix -Asystem=hpux -Acpu=hppa -Amachine=hppa" - #undef LINK_SPEC #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11) #define LINK_SPEC \ diff --git a/gcc/config/pa/pa-hpux10.h b/gcc/config/pa/pa-hpux10.h index ce9969d59f7..0354543e3d0 100644 --- a/gcc/config/pa/pa-hpux10.h +++ b/gcc/config/pa/pa-hpux10.h @@ -1,5 +1,6 @@ -/* Definitions of target machine for GNU compiler, for HP PA-RISC 1.1 - Copyright (C) 1995, 1996, 1997, 2000, 2001 Free Software Foundation, Inc. +/* Definitions of target machine for GNU compiler, for HP PA-RISC + Copyright (C) 1995, 1996, 1997, 2000, 2001, 2002 + Free Software Foundation, Inc. Contributed by Tim Moore (moore@defmacro.cs.utah.edu) This file is part of GNU CC. @@ -19,6 +20,52 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_assert ("system=hpux"); \ + builtin_assert ("system=unix"); \ + builtin_define ("__hp9000s800"); \ + builtin_define ("__hp9000s800__"); \ + builtin_define ("__hpux"); \ + builtin_define ("__hpux__"); \ + builtin_define ("__unix"); \ + builtin_define ("__unix__"); \ + if (c_language == clk_cplusplus) \ + { \ + builtin_define ("_HPUX_SOURCE"); \ + builtin_define ("_INCLUDE_LONGLONG"); \ + } \ + else if (!flag_iso) \ + { \ + builtin_define ("_HPUX_SOURCE"); \ + if (preprocessing_trad_p ()) \ + { \ + builtin_define ("hp9000s800"); \ + builtin_define ("hppa"); \ + builtin_define ("hpux"); \ + builtin_define ("unix"); \ + builtin_define ("__CLASSIC_C__"); \ + builtin_define ("_PWB"); \ + builtin_define ("PWB"); \ + } \ + else \ + builtin_define ("__STDC_EXT__"); \ + } \ + if (TARGET_SIO) \ + builtin_define ("_SIO"); \ + else \ + { \ + builtin_define ("__hp9000s700"); \ + builtin_define ("__hp9000s700__"); \ + builtin_define ("_WSIO"); \ + } \ + } \ + while (0) + +#define CPP_SPEC "%{threads: -D_REENTRANT -D_DCE_THREADS}" + /* We can debug dynamically linked executables on hpux9; we also want dereferencing of a NULL pointer to cause a SEGV. */ #undef LINK_SPEC diff --git a/gcc/config/pa/pa-hpux11.h b/gcc/config/pa/pa-hpux11.h index 522605453f6..0bc7f1010a5 100644 --- a/gcc/config/pa/pa-hpux11.h +++ b/gcc/config/pa/pa-hpux11.h @@ -1,5 +1,5 @@ -/* Definitions of target machine for GNU compiler, for HP PA-RISC 1.1 - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. +/* Definitions of target machine for GNU compiler, for HP PA-RISC + Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU CC. @@ -18,6 +18,55 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_assert ("system=hpux"); \ + builtin_assert ("system=unix"); \ + builtin_define ("__hp9000s800"); \ + builtin_define ("__hp9000s800__"); \ + builtin_define ("__hpux"); \ + builtin_define ("__hpux__"); \ + builtin_define ("__unix"); \ + builtin_define ("__unix__"); \ + if (c_language == clk_cplusplus) \ + { \ + builtin_define ("_HPUX_SOURCE"); \ + builtin_define ("_INCLUDE_LONGLONG"); \ + } \ + else \ + { \ + if (!flag_iso) \ + { \ + builtin_define ("_HPUX_SOURCE"); \ + if (preprocessing_trad_p ()) \ + { \ + builtin_define ("hp9000s800"); \ + builtin_define ("hppa"); \ + builtin_define ("hpux"); \ + builtin_define ("unix"); \ + builtin_define ("__CLASSIC_C__"); \ + builtin_define ("_PWB"); \ + builtin_define ("PWB"); \ + } \ + else \ + builtin_define ("__STDC_EXT__"); \ + } \ + if (!TARGET_64BIT) \ + builtin_define ("_ILP32"); \ + } \ + if (TARGET_SIO) \ + builtin_define ("_SIO"); \ + else \ + { \ + builtin_define ("__hp9000s700"); \ + builtin_define ("__hp9000s700__"); \ + builtin_define ("_WSIO"); \ + } \ + } \ + while (0) + /* We can debug dynamically linked executables on hpux11; we also want dereferencing of a NULL pointer to cause a SEGV. */ #undef LINK_SPEC diff --git a/gcc/config/pa/pa-hpux7.h b/gcc/config/pa/pa-hpux7.h index 42c335849a8..0239e038cf8 100644 --- a/gcc/config/pa/pa-hpux7.h +++ b/gcc/config/pa/pa-hpux7.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for HP-UX. - Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1991, 1995, 1996, 2002 Free Software Foundation, Inc. This file is part of GNU CC. @@ -29,9 +29,58 @@ Boston, MA 02111-1307, USA. */ #define SIZE_TYPE "unsigned int" #define PTRDIFF_TYPE "int" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_assert ("system=hpux"); \ + builtin_assert ("system=unix"); \ + builtin_define ("__hp9000s800"); \ + builtin_define ("__hp9000s800__"); \ + builtin_define ("__hp9k8"); \ + builtin_define ("__hp9k8__"); \ + builtin_define ("__hpux"); \ + builtin_define ("__hpux__"); \ + builtin_define ("__unix"); \ + builtin_define ("__unix__"); \ + if (c_language == clk_cplusplus) \ + { \ + builtin_define ("_HPUX_SOURCE"); \ + builtin_define ("_INCLUDE_LONGLONG"); \ + } \ + else if (!flag_iso) \ + { \ + builtin_define ("_HPUX_SOURCE"); \ + if (preprocessing_trad_p ()) \ + { \ + builtin_define ("hp9000s800"); \ + builtin_define ("hp9k8"); \ + builtin_define ("hppa"); \ + builtin_define ("hpux"); \ + builtin_define ("unix"); \ + builtin_define ("__CLASSIC_C__"); \ + builtin_define ("_PWB"); \ + builtin_define ("PWB"); \ + } \ + else \ + builtin_define ("__STDC_EXT__"); \ + } \ + if (TARGET_SIO) \ + builtin_define ("_SIO"); \ + else \ + { \ + builtin_define ("__hp9000s700"); \ + builtin_define ("__hp9000s700__"); \ + builtin_define ("_WSIO"); \ + } \ + } \ + while (0) + +#undef SUBTARGET_SWITCHES +#define SUBTARGET_SWITCHES \ + { "sio", MASK_SIO, N_("Generate cpp defines for server IO") }, \ + { "wsio", -MASK_SIO, N_("Generate cpp defines for workstation IO") }, + /* Like the default, except no -lg. */ #undef LIB_SPEC #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}" - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -Asystem=unix -Asystem=hpux -Acpu=hppa -Amachine=hppa" diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h index 0fcb1e5095c..86dfabc77b7 100644 --- a/gcc/config/pa/pa-linux.h +++ b/gcc/config/pa/pa-linux.h @@ -56,8 +56,22 @@ Boston, MA 02111-1307, USA. */ } \ } while (0) -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-D__ELF__ -Dunix -D__hppa__ -D__gnu_linux__ -Dlinux -Asystem=unix -Asystem=posix -Acpu=hppa -Amachine=hppa -Amachine=bigendian" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__ELF__"); \ + builtin_define ("__gnu_linux__"); \ + builtin_define_std ("linux"); \ + builtin_define_std ("unix"); \ + builtin_assert ("machine=bigendian"); \ + builtin_assert ("system=posix"); \ + builtin_assert ("system=unix"); \ + } \ + while (0) + +#undef CPP_SPEC +#define CPP_SPEC "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}" #undef LIB_SPEC #define LIB_SPEC \ diff --git a/gcc/config/pa/pa-osf.h b/gcc/config/pa/pa-osf.h index 04086a57b2d..74a6e588505 100644 --- a/gcc/config/pa/pa-osf.h +++ b/gcc/config/pa/pa-osf.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for HP PA-RISC 1.1 - Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1991, 1995, 1996, 2002 Free Software Foundation, Inc. Contributed by Tim Moore (moore@defmacro.cs.utah.edu) This file is part of GNU CC. @@ -19,12 +19,34 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#undef CPP_PREDEFINES -#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11) -#define CPP_PREDEFINES "-Dhppa -Dunix -Dhp9000 -Dspectrum -DREVARGV -Dhp700 -DHP700 -Dparisc -D__pa_risc -DPARISC -DBYTE_MSF -DBIT_MSF -Asystem=unix -Asystem=mach -Acpu=hppa -Amachine=hppa" -#else -#define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -Dunix -Dhp9000 -Dhp800 -Dspectrum -DREVARGV -Dparisc -D__pa_risc -DPARISC -DBYTE_MSF -DBIT_MSF -Asystem=unix -Asystem=mach -Acpu=hppa -Amachine=hppa" -#endif +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + if (TARGET_PA_11) \ + { \ + builtin_define_std ("hp700"); \ + builtin_define_std ("HP700"); \ + } \ + else \ + { \ + builtin_define_std ("hp800"); \ + builtin_define_std ("hp9k8"); \ + builtin_define_std ("hp9000s800"); \ + } \ + builtin_define_std ("BIT_MSF"); \ + builtin_define_std ("BYTE_MSF"); \ + builtin_define_std ("PARISC"); \ + builtin_define_std ("REVARGV"); \ + builtin_define_std ("hp9000"); \ + builtin_define ("__pa_risc"); \ + builtin_define_std ("parisc"); \ + builtin_define_std ("spectrum"); \ + builtin_define_std ("unix"); \ + builtin_assert ("system=mach"); \ + builtin_assert ("system=unix"); \ + } \ + while (0) /* Don't default to pcc-struct-return, because gcc is the only compiler, and we want to retain compatibility with older gcc versions. */ diff --git a/gcc/config/pa/pa-pro-end.h b/gcc/config/pa/pa-pro-end.h index f9093909828..a1bd30dc65d 100644 --- a/gcc/config/pa/pa-pro-end.h +++ b/gcc/config/pa/pa-pro-end.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for PRO. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc. This file is part of GNU CC. @@ -25,13 +25,25 @@ Boston, MA 02111-1307, USA. */ #define SIZE_TYPE "unsigned int" #define PTRDIFF_TYPE "int" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + if (c_language != clk_cplusplus \ + && !flag_iso) \ + { \ + builtin_define ("hppa"); \ + builtin_define_std ("PWB"); \ + } \ + builtin_define ("__pro__"); \ + builtin_assert ("system=pro"); \ + } \ + while (0) + /* Like the default, except no -lg. */ #undef LIB_SPEC #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}" -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dhppa -DPWB -Acpu=hppa -D__pro__ -Amachine=hppa" - /* hpux8 and later have C++ compatible include files, so do not pretend they are `extern "C"'. */ #define NO_IMPLICIT_EXTERN_C diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index aeef60fccf2..7813d7c5e64 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -74,14 +74,10 @@ extern enum architecture_type pa_arch; extern int target_flags; -/* compile code for HP-PA 1.1 ("Snake") */ +/* compile code for HP-PA 1.1 ("Snake"). */ #define MASK_PA_11 1 -#ifndef TARGET_PA_11 -#define TARGET_PA_11 (target_flags & MASK_PA_11) -#endif - /* Disable all FP registers (they all become fixed). This may be necessary for compiling kernels which perform lazy context switching of FP regs. Note if you use this option and try to perform floating point operations @@ -142,10 +138,22 @@ extern int target_flags; #define MASK_BIG_SWITCH 2048 #define TARGET_BIG_SWITCH (target_flags & MASK_BIG_SWITCH) - /* Generate code for the HPPA 2.0 architecture. TARGET_PA_11 should also be true when this is true. */ #define MASK_PA_20 4096 + +/* Generate cpp defines for server I/O. */ +#define MASK_SIO 8192 +#define TARGET_SIO (target_flags & MASK_SIO) + +#ifndef TARGET_PA_10 +#define TARGET_PA_10 (target_flags & (MASK_PA_11 | MASK_PA_20) == 0) +#endif + +#ifndef TARGET_PA_11 +#define TARGET_PA_11 (target_flags & MASK_PA_11) +#endif + #ifndef TARGET_PA_20 #define TARGET_PA_20 (target_flags & MASK_PA_20) #endif @@ -165,40 +173,69 @@ extern int target_flags; #define TARGET_SOM 0 #endif -/* Macro to define tables used to set the flags. - This is a list in braces of pairs in braces, - each pair being { "NAME", VALUE } - where VALUE is the bits to set or minus the bits to clear. - An empty string NAME is used to identify the default VALUE. */ +/* Macro to define tables used to set the flags. This is a + list in braces of target switches with each switch being + { "NAME", VALUE, "HELP_STRING" }. VALUE is the bits to set, + or minus the bits to clear. An empty string NAME is used to + identify the default VALUE. Do not mark empty strings for + translation. */ #define TARGET_SWITCHES \ - {{"snake", MASK_PA_11, "Generate PA1.1 code"}, \ - {"nosnake", -(MASK_PA_11 | MASK_PA_20), "Generate PA1.0 code"}, \ - {"pa-risc-1-0", -(MASK_PA_11 | MASK_PA_20), "Generate PA1.0 code"}, \ - {"pa-risc-1-1", MASK_PA_11, "Generate PA1.1 code"}, \ - {"pa-risc-2-0", MASK_PA_20, "Generate PA2.0 code. This option requires binutils 2.10 or later"}, \ - {"disable-fpregs", MASK_DISABLE_FPREGS, "Disable FP regs"}, \ - {"no-disable-fpregs", -MASK_DISABLE_FPREGS, "Do not disable FP regs"},\ - {"no-space-regs", MASK_NO_SPACE_REGS, "Disable space regs"}, \ - {"space-regs", -MASK_NO_SPACE_REGS, "Do not disable space regs"}, \ - {"jump-in-delay", MASK_JUMP_IN_DELAY, "Put jumps in call delay slots"},\ - {"no-jump-in-delay", -MASK_JUMP_IN_DELAY, "Do not put jumps in call delay slots"}, \ - {"disable-indexing", MASK_DISABLE_INDEXING, "Disable indexed addressing"},\ - {"no-disable-indexing", -MASK_DISABLE_INDEXING, "Do not disable indexed addressing"},\ - {"portable-runtime", MASK_PORTABLE_RUNTIME, "Use portable calling conventions"}, \ - {"no-portable-runtime", -MASK_PORTABLE_RUNTIME, "Do not use portable calling conventions"},\ - {"gas", MASK_GAS, "Assume code will be assembled by GAS"}, \ - {"no-gas", -MASK_GAS, "Do not assume code will be assembled by GAS"}, \ - {"soft-float", MASK_SOFT_FLOAT, "Use software floating point"}, \ - {"no-soft-float", -MASK_SOFT_FLOAT, "Do not use software floating point"}, \ - {"long-load-store", MASK_LONG_LOAD_STORE, "Emit long load/store sequences"}, \ - {"no-long-load-store", -MASK_LONG_LOAD_STORE, "Do not emit long load/store sequences"},\ - {"fast-indirect-calls", MASK_FAST_INDIRECT_CALLS, "Generate fast indirect calls"},\ - {"no-fast-indirect-calls", -MASK_FAST_INDIRECT_CALLS, "Do not generate fast indirect calls"},\ - {"big-switch", MASK_BIG_SWITCH, "Generate code for huge switch statements"}, \ - {"no-big-switch", -MASK_BIG_SWITCH, "Do not generate code for huge switch statements"}, \ - {"linker-opt", 0, "Enable linker optimizations"}, \ - { "", TARGET_DEFAULT | TARGET_CPU_DEFAULT, NULL}} + {{ "snake", MASK_PA_11, \ + N_("Generate PA1.1 code") }, \ + { "nosnake", -(MASK_PA_11 | MASK_PA_20), \ + N_("Generate PA1.0 code") }, \ + { "pa-risc-1-0", -(MASK_PA_11 | MASK_PA_20), \ + N_("Generate PA1.0 code") }, \ + { "pa-risc-1-1", MASK_PA_11, \ + N_("Generate PA1.1 code") }, \ + { "pa-risc-2-0", MASK_PA_20, \ + N_("Generate PA2.0 code (requires binutils 2.10 or later)") }, \ + { "disable-fpregs", MASK_DISABLE_FPREGS, \ + N_("Disable FP regs") }, \ + { "no-disable-fpregs", -MASK_DISABLE_FPREGS, \ + N_("Do not disable FP regs") }, \ + { "no-space-regs", MASK_NO_SPACE_REGS, \ + N_("Disable space regs") }, \ + { "space-regs", -MASK_NO_SPACE_REGS, \ + N_("Do not disable space regs") }, \ + { "jump-in-delay", MASK_JUMP_IN_DELAY, \ + N_("Put jumps in call delay slots") }, \ + { "no-jump-in-delay", -MASK_JUMP_IN_DELAY, \ + N_("Do not put jumps in call delay slots") }, \ + { "disable-indexing", MASK_DISABLE_INDEXING, \ + N_("Disable indexed addressing") }, \ + { "no-disable-indexing", -MASK_DISABLE_INDEXING, \ + N_("Do not disable indexed addressing") }, \ + { "portable-runtime", MASK_PORTABLE_RUNTIME, \ + N_("Use portable calling conventions") }, \ + { "no-portable-runtime", -MASK_PORTABLE_RUNTIME, \ + N_("Do not use portable calling conventions") }, \ + { "gas", MASK_GAS, \ + N_("Assume code will be assembled by GAS") }, \ + { "no-gas", -MASK_GAS, \ + N_("Do not assume code will be assembled by GAS") }, \ + { "soft-float", MASK_SOFT_FLOAT, \ + N_("Use software floating point") }, \ + { "no-soft-float", -MASK_SOFT_FLOAT, \ + N_("Do not use software floating point") }, \ + { "long-load-store", MASK_LONG_LOAD_STORE, \ + N_("Emit long load/store sequences") }, \ + { "no-long-load-store", -MASK_LONG_LOAD_STORE, \ + N_("Do not emit long load/store sequences") }, \ + { "fast-indirect-calls", MASK_FAST_INDIRECT_CALLS, \ + N_("Generate fast indirect calls") }, \ + { "no-fast-indirect-calls", -MASK_FAST_INDIRECT_CALLS, \ + N_("Do not generate fast indirect calls") }, \ + { "big-switch", MASK_BIG_SWITCH, \ + N_("Generate code for huge switch statements") }, \ + { "no-big-switch", -MASK_BIG_SWITCH, \ + N_("Do not generate code for huge switch statements") }, \ + { "linker-opt", 0, \ + N_("Enable linker optimizations") }, \ + SUBTARGET_SWITCHES \ + { "", TARGET_DEFAULT | TARGET_CPU_DEFAULT, \ + NULL }} #ifndef TARGET_DEFAULT #define TARGET_DEFAULT (MASK_GAS | MASK_JUMP_IN_DELAY) @@ -208,14 +245,20 @@ extern int target_flags; #define TARGET_CPU_DEFAULT 0 #endif +#ifndef SUBTARGET_SWITCHES +#define SUBTARGET_SWITCHES +#endif + #ifndef TARGET_SCHED_DEFAULT #define TARGET_SCHED_DEFAULT "8000" #endif -#define TARGET_OPTIONS \ -{ \ - { "schedule=", &pa_cpu_string, "Specify CPU for scheduling purposes" },\ - { "arch=", &pa_arch_string, "Specify architecture for code generation. Values are 1.0, 1.1, and 2.0. 2.0 requires gas snapshot 19990413 or later." }\ +#define TARGET_OPTIONS \ +{ \ + { "schedule=", &pa_cpu_string, \ + N_("Specify CPU for scheduling purposes") }, \ + { "arch=", &pa_arch_string, \ + N_("Specify architecture for code generation. Values are 1.0, 1.1, and 2.0. 2.0 requires gas snapshot 19990413 or later.") }\ } /* Specify the dialect of assembler to use. New mnemonics is dialect one @@ -265,75 +308,42 @@ extern int target_flags; ((GET_CODE (X) == PLUS ? OFFSET : 0) \ + (frame_pointer_needed ? 0 : compute_frame_size (get_frame_size (), 0))) -#define CPP_PA10_SPEC "" -#define CPP_PA11_SPEC "-D_PA_RISC1_1 -D__hp9000s700" -#define CPP_PA20_SPEC "-D_PA_RISC2_0 -D__hp9000s800" -#define CPP_64BIT_SPEC "-D__LP64__" - -#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11) == 0 -#define CPP_CPU_DEFAULT_SPEC "%(cpp_pa10)" -#endif - -#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11) != 0 -#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_20) != 0 -#define CPP_CPU_DEFAULT_SPEC "%(cpp_pa11) %(cpp_pa20)" -#else -#define CPP_CPU_DEFAULT_SPEC "%(cpp_pa11)" -#endif -#endif - -#if TARGET_64BIT -#define CPP_64BIT_DEFAULT_SPEC "%(cpp_64bit)" -#else -#define CPP_64BIT_DEFAULT_SPEC "" -#endif - -/* This macro defines names of additional specifications to put in the - specs that can be used in various specifications like CC1_SPEC. Its - definition is an initializer with a subgrouping for each command option. - - Each subgrouping contains a string constant, that defines the - specification name, and a string constant that used by the GNU CC driver - program. - - Do not define this macro if it does not need to do anything. */ - -#ifndef SUBTARGET_EXTRA_SPECS -#define SUBTARGET_EXTRA_SPECS -#endif +#define TARGET_CPU_CPP_BUILTINS() \ +do { \ + builtin_assert("cpu=hppa"); \ + builtin_assert("machine=hppa"); \ + builtin_define("__hppa"); \ + builtin_define("__hppa__"); \ + if (TARGET_64BIT) \ + { \ + builtin_define("_LP64"); \ + builtin_define("__LP64__"); \ + } \ + if (TARGET_PA_20) \ + builtin_define("_PA_RISC2_0"); \ + else if (TARGET_PA_11) \ + builtin_define("_PA_RISC1_1"); \ + else \ + builtin_define("_PA_RISC1_0"); \ +} while (0) -#define EXTRA_SPECS \ - { "cpp_pa10", CPP_PA10_SPEC}, \ - { "cpp_pa11", CPP_PA11_SPEC}, \ - { "cpp_pa20", CPP_PA20_SPEC}, \ - { "cpp_64bit", CPP_64BIT_SPEC}, \ - { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \ - { "cpp_64bit_default", CPP_64BIT_DEFAULT_SPEC }, \ - SUBTARGET_EXTRA_SPECS - -#define CPP_SPEC "\ -%{mpa-risc-1-0:%(cpp_pa10)} \ -%{mpa-risc-1-1:%(cpp_pa11)} \ -%{msnake:%(cpp_pa11)} \ -%{mpa-risc-2-0:%(cpp_pa20)} \ -%{!mpa-risc-1-0:%{!mpa-risc-1-1:%{!mpa-risc-2-0:%{!msnake:%(cpp_cpu_default)}}}} \ -%{m64bit:%(cpp_64bit)} \ -%{!m64bit:%(cpp_64bit_default)} \ -%{!ansi: -D_HPUX_SOURCE -D_HIUX_SOURCE -D__STDC_EXT__ -D_INCLUDE_LONGLONG} \ -%{threads: -D_REENTRANT -D_DCE_THREADS}" - -#define CPLUSPLUS_CPP_SPEC "\ --D_HPUX_SOURCE -D_HIUX_SOURCE -D__STDC_EXT__ -D_INCLUDE_LONGLONG \ -%{mpa-risc-1-0:%(cpp_pa10)} \ -%{mpa-risc-1-1:%(cpp_pa11)} \ -%{msnake:%(cpp_pa11)} \ -%{mpa-risc-2-0:%(cpp_pa20)} \ -%{!mpa-risc-1-0:%{!mpa-risc-1-1:%{!mpa-risc-2-0:%{!msnake:%(cpp_cpu_default)}}}} \ -%{m64bit:%(cpp_64bit)} \ -%{!m64bit:%(cpp_64bit_default)} \ -%{threads: -D_REENTRANT -D_DCE_THREADS}" - -/* Defines for a K&R CC */ +/* An old set of OS defines for various BSD-like systems. */ +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("REVARGV"); \ + builtin_define_std ("hp800"); \ + builtin_define_std ("hp9000"); \ + builtin_define_std ("hp9k8"); \ + if (c_language != clk_cplusplus \ + && !flag_iso) \ + builtin_define ("hppa"); \ + builtin_define_std ("spectrum"); \ + builtin_define_std ("unix"); \ + builtin_assert ("system=bsd"); \ + builtin_assert ("system=unix"); \ + } \ + while (0) #define CC1_SPEC "%{pg:} %{p:}" @@ -366,9 +376,6 @@ extern int target_flags; /* Machine dependent reorg pass. */ #define MACHINE_DEPENDENT_REORG(X) pa_reorg(X) -/* Names to predefine in the preprocessor for this target machine. */ - -#define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -Dunix -Dhp9000 -Dhp800 -Dspectrum -DREVARGV -Asystem=unix -Asystem=bsd -Acpu=hppa -Amachine=hppa" /* target machine storage layout */ diff --git a/gcc/config/pa/pa32-linux.h b/gcc/config/pa/pa32-linux.h index 81f64529a3a..a5c1da2fa62 100644 --- a/gcc/config/pa/pa32-linux.h +++ b/gcc/config/pa/pa32-linux.h @@ -21,6 +21,3 @@ Boston, MA 02111-1307, USA. */ /* Turn off various SOM crap we don't want. */ #undef TARGET_ELF32 #define TARGET_ELF32 1 - -#undef CPP_SPEC -#define CPP_SPEC "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{mhppa:-D__hppa__} %{posix:-D_POSIX_SOURCE} -D_PA_RISC1_1" diff --git a/gcc/config/pa/pa64-linux.h b/gcc/config/pa/pa64-linux.h index 1691633d1cb..82a2b05005b 100644 --- a/gcc/config/pa/pa64-linux.h +++ b/gcc/config/pa/pa64-linux.h @@ -1,5 +1,5 @@ /* Definitions for PA_RISC with ELF format on 64-bit Linux - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU CC. @@ -18,9 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#undef CPP_SPEC -#define CPP_SPEC "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{mhppa:-D__hppa__} %{posix:-D_POSIX_SOURCE} -D_PA_RISC2_0 -D__LP64__" - #if 0 /* needs some work :-( */ /* If defined, this macro specifies a table of register pairs used to eliminate unneeded registers that point into the stack frame. */ diff --git a/gcc/config/pa/rtems.h b/gcc/config/pa/rtems.h index fe83e85f044..b03b5c802c3 100644 --- a/gcc/config/pa/rtems.h +++ b/gcc/config/pa/rtems.h @@ -21,6 +21,17 @@ Boston, MA 02111-1307, USA. */ /* Specify predefined symbols in preprocessor. */ -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dhppa -DPWB -Acpu=hppa -Amachine=hppa \ - -D__rtems__ -Asystem=rtems" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + if (c_language != clk_cplusplus \ + && !flag_iso) \ + { \ + builtin_define ("hppa"); \ + builtin_define_std ("PWB"); \ + } \ + builtin_define ("__rtems__"); \ + builtin_assert ("system=rtems"); \ + } \ + while (0) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 6d8eedc4e46..f1ddd5d68c4 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -508,7 +508,7 @@ in the following sections. -mno-portable-runtime -mno-soft-float @gol -mno-space-regs -msoft-float -mpa-risc-1-0 @gol -mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime @gol --mschedule=@var{cpu-type} -mspace-regs} +-mschedule=@var{cpu-type} -mspace-regs -msio -mwsio} @emph{Intel 960 Options} @gccoptlist{ @@ -7901,9 +7901,9 @@ proper scheduling option for your machine. The default scheduling is @item -mlinker-opt @opindex mlinker-opt -Enable the optimization pass in the HPUX linker. Note this makes symbolic -debugging impossible. It also triggers a bug in the HPUX 8 and HPUX 9 linkers -in which they give bogus error messages when linking some programs. +Enable the optimization pass in the HP-UX linker. Note this makes symbolic +debugging impossible. It also triggers a bug in the HP-UX 8 and HP-UX 9 +linkers in which they give bogus error messages when linking some programs. @item -msoft-float @opindex msoft-float @@ -7920,6 +7920,13 @@ therefore, it is only useful if you compile @emph{all} of a program with this option. In particular, you need to compile @file{libgcc.a}, the library that comes with GCC, with @option{-msoft-float} in order for this to work. + +@item -msio +@opindex msio +Generate the predefine, @code{_SIO}, for server IO. The default is +@option{-mwsio}. This generates the predefines, @code{__hp9000s700}, +@code{__hp9000s700__} and @code{_WSIO}, for workstation IO. These +options are available under HP-UX and HI-UX. @end table @node Intel 960 Options @@ -9125,7 +9132,7 @@ These are the @samp{-m} options defined for the Intel IA-64 architecture. @table @gcctabopt @item -mbig-endian @opindex mbig-endian -Generate code for a big endian target. This is the default for HPUX@. +Generate code for a big endian target. This is the default for HP-UX@. @item -mlittle-endian @opindex mlittle-endian diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index c328ce709fa..4cbaeb70542 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -615,7 +615,9 @@ or @code{clk_objective_c}. Note that if we are preprocessing assembler, this variable will be @code{clk_c} but the function-like macro @code{preprocessing_asm_p()} will return true, so you might want to check for that first. If you need to check for strict ANSI, the -variable @code{flag_iso} can be used. +variable @code{flag_iso} can be used. The function-like macro +@code{preprocessing_trad_p()} can be used to check for traditional +preprocessing. With @code{TARGET_OS_CPP_BUILTINS} this macro obsoletes the @code{CPP_PREDEFINES} target macro. -- 2.11.0