summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-02 21:00:50 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-02 21:00:50 +0000
commitb2e455f87d2e6cc23dfed04f13519f1b9810bfd6 (patch)
treea5885cafe21ad61fbb546134bbde6d487591d94c
parent4f8e9d5c57e3ca403d0460f3a13d8cc1a9704da8 (diff)
downloadgcc-b2e455f87d2e6cc23dfed04f13519f1b9810bfd6.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54187 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/h8300/elf.h7
-rw-r--r--gcc/config/h8300/h8300.h50
-rw-r--r--gcc/config/h8300/rtems.h11
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 <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.
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)