From 537fc532be12254466f5d19fbaf40dc5016d6f81 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sun, 2 Jun 2002 21:00:50 +0000 Subject: [PATCH] elf.h: Use TARGET_OS_CPP_BUILTINS rather than SUBTARGET_SPEC. config/h8300: * elf.h: Use TARGET_OS_CPP_BUILTINS rather than SUBTARGET_SPEC. * rtems.h: Similarly. * h8300.h (CPP_PREDEFINES, CPP_SPEC, SUBTARGET_CPP_SPEC, EXTRA_SPECS, SUBTARGET_EXTRA_SPECS): Remove. (TARGET_CPU_CPP_BUILTINS): Use. From-SVN: r54187 --- gcc/ChangeLog | 10 ++++++++ gcc/config/h8300/elf.h | 7 ++++-- gcc/config/h8300/h8300.h | 50 ++++++++++++++++++++++++---------------- gcc/config/h8300/rtems.h | 11 +++++---- 4 files changed, 52 insertions(+), 26 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 54cc7a4eef0..f931d52e98d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2002-06-02 Neil Booth + +config/h8300: + * elf.h: Use TARGET_OS_CPP_BUILTINS rather than + SUBTARGET_SPEC. + * rtems.h: Similarly. + * h8300.h (CPP_PREDEFINES, CPP_SPEC, SUBTARGET_CPP_SPEC, + EXTRA_SPECS, SUBTARGET_EXTRA_SPECS): Remove. + (TARGET_CPU_CPP_BUILTINS): Use. + 2002-06-02 Richard Henderson * alias.c: Include target.h. diff --git a/gcc/config/h8300/elf.h b/gcc/config/h8300/elf.h index 7aad2a64c8c..81e320c061d 100644 --- a/gcc/config/h8300/elf.h +++ b/gcc/config/h8300/elf.h @@ -1,5 +1,8 @@ -#undef SUBTARGET_CPP_SPEC -#define SUBTARGET_CPP_SPEC "-D__ELF__" +/* Target OS preprocessor built-ins. */ +#define TARGET_OS_CPP_BUILTINS() \ + do { \ + builtin_define ("__ELF__"); \ + } while (0) /* Undefine some macros defined in h8300 that conflict with elfos.h . */ #undef SDB_DEBUGGING_INFO diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index 2bee304bbe8..78bd8d33ec4 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -37,31 +37,41 @@ extern int cpu_type; extern const char *h8_push_op, *h8_pop_op, *h8_mov_op; extern const char * const *h8_reg_names; -/* Names to predefine in the preprocessor for this target machine. */ - -#define CPP_PREDEFINES \ -"-D__LONG_MAX__=2147483647L -D__LONG_LONG_MAX__=2147483647L" - -#define CPP_SPEC \ - "%{!mh:%{!ms:-D__H8300__}} %{mh:-D__H8300H__} %{ms:-D__H8300S__} \ - %{!mh:%{!ms:-Acpu=h8300 -Amachine=h8300}} \ - %{mh:-Acpu=h8300h -Amachine=h8300h} \ - %{ms:-Acpu=h8300s -Amachine=h8300s} \ - %{!mint32:-D__INT_MAX__=32767} %{mint32:-D__INT_MAX__=2147483647} \ - %(subtarget_cpp_spec)" - -#define SUBTARGET_CPP_SPEC "" +/* Target CPU builtins. */ +#define TARGET_CPU_CPP_BUILTINS() \ + do \ + { \ + if (TARGET_H8300H) \ + { \ + builtin_define ("__H8300H__"); \ + builtin_assert ("cpu=h8300h"); \ + builtin_assert ("machine=h8300h"); \ + } \ + else if (TARGET_H8300S) \ + { \ + builtin_define ("__H8300S__"); \ + builtin_assert ("cpu=h8300s"); \ + builtin_assert ("machine=h8300s"); \ + } \ + else \ + { \ + builtin_define ("__H8300__"); \ + builtin_assert ("cpu=h8300"); \ + builtin_assert ("machine=h8300"); \ + } \ + if (TARGET_INT32) \ + builtin_define ("__INT_MAX__=2147483647"); \ + else \ + builtin_define ("__INT_MAX__=32767"); \ + builtin_define ("__LONG_MAX__=2147483647L"); \ + builtin_define ("__LONG_LONG_MAX__=2147483647L"); \ + } \ + while (0) #define LINK_SPEC "%{mh:-m h8300h} %{ms:-m h8300s}" #define LIB_SPEC "%{mrelax:-relax} %{g:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" -#define EXTRA_SPECS \ - { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }, \ - SUBTARGET_EXTRA_SPECS - -#define SUBTARGET_EXTRA_SPECS - /* Print subsidiary information on the compiler version in use. */ #define TARGET_VERSION fprintf (stderr, " (Hitachi H8/300)"); diff --git a/gcc/config/h8300/rtems.h b/gcc/config/h8300/rtems.h index 2e7676f41f9..6b487cd1b7b 100644 --- a/gcc/config/h8300/rtems.h +++ b/gcc/config/h8300/rtems.h @@ -19,7 +19,10 @@ 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 -#define CPP_PREDEFINES "-Dh8300 \ - -D__LONG_MAX__=2147483647L -D__LONG_LONG_MAX__=2147483647L \ - -D__rtems__ -Asystem=rtems" +/* Target OS preprocessor built-ins. */ +#define TARGET_OS_CPP_BUILTINS() \ + do { \ + builtin_define_std ("h8300"); \ + builtin_define ("__rtems__"); \ + builtin_assert ("system=rtems"); \ + } while (0) -- 2.30.2