OSDN Git Service

config/h8300:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 2 Jun 2002 21:00:50 +0000 (21:00 +0000)
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 2 Jun 2002 21:00:50 +0000 (21:00 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54187 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/h8300/elf.h
gcc/config/h8300/h8300.h
gcc/config/h8300/rtems.h

index 54cc7a4..f931d52 100644 (file)
@@ -1,3 +1,13 @@
+2002-06-02  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+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  <rth@redhat.com>
 
        * alias.c: Include target.h.
index 7aad2a6..81e320c 100644 (file)
@@ -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
index 2bee304..78bd8d3 100644 (file)
@@ -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)");
index 2e7676f..6b487cd 100644 (file)
@@ -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)