aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Thorpe <thorpej@wasabisystems.com>2002-11-26 15:46:40 +0000
committerJason Thorpe <thorpej@gcc.gnu.org>2002-11-26 15:46:40 +0000
commit647d340d4bcf9140b870b5ada6d3c08957d674a5 (patch)
tree0a32cf922d630f6ada80600fc881203cd80c9825
parent29742ba4f4eff92353b98ea0a7a039053ccb8de7 (diff)
downloadgcc-647d340d4bcf9140b870b5ada6d3c08957d674a5.zip
gcc-647d340d4bcf9140b870b5ada6d3c08957d674a5.tar.gz
gcc-647d340d4bcf9140b870b5ada6d3c08957d674a5.tar.bz2
rs6000.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): New.
* config/rs6000/rs6000.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): New. * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Use RS6000_CPU_CPP_ENDIAN_BUILTINS. * config/rs6000/netbsd.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): Redefine. From-SVN: r59518
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/rs6000/netbsd.h20
-rw-r--r--gcc/config/rs6000/rs6000-c.c16
-rw-r--r--gcc/config/rs6000/rs6000.h20
4 files changed, 51 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fd2047e..51b1e88 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2002-11-26 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config/rs6000/rs6000.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): New.
+ * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Use
+ RS6000_CPU_CPP_ENDIAN_BUILTINS.
+ * config/rs6000/netbsd.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): Redefine.
+
2002-11-26 Hartmut Penner <hpenner@de.ibm.com>
* config/s390/s390.md (literal_pool_64, literal_pool_31 ): New
diff --git a/gcc/config/rs6000/netbsd.h b/gcc/config/rs6000/netbsd.h
index 6791a4d..b473a8a 100644
--- a/gcc/config/rs6000/netbsd.h
+++ b/gcc/config/rs6000/netbsd.h
@@ -31,6 +31,26 @@ Boston, MA 02111-1307, USA. */
} \
while (0)
+/* Override the default from rs6000.h to avoid conflicts with macros
+ defined in NetBSD header files. */
+
+#undef RS6000_CPU_CPP_ENDIAN_BUILTINS
+#define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
+ do \
+ { \
+ if (BYTES_BIG_ENDIAN) \
+ { \
+ builtin_define ("__BIG_ENDIAN__"); \
+ builtin_assert ("machine=bigendian"); \
+ } \
+ else \
+ { \
+ builtin_define ("__LITTLE_ENDIAN__"); \
+ builtin_assert ("machine=littleendian"); \
+ } \
+ } \
+ while (0)
+
/* Make GCC agree with <machine/ansi.h>. */
#undef SIZE_TYPE
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index 6093996..03f91ba 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -100,18 +100,10 @@ rs6000_cpu_cpp_builtins (pfile)
/* Used by lwarx/stwcx. errata work-around. */
if (rs6000_cpu == PROCESSOR_PPC405)
builtin_define ("__PPC405__");
- if (BYTES_BIG_ENDIAN)
- {
- builtin_define ("__BIG_ENDIAN__");
- builtin_define ("_BIG_ENDIAN");
- builtin_assert ("machine=bigendian");
- }
- else
- {
- builtin_define ("__LITTLE_ENDIAN__");
- builtin_define ("_LITTLE_ENDIAN");
- builtin_assert ("machine=littleendian");
- }
+
+ /* May be overridden by target configuration. */
+ RS6000_CPU_CPP_ENDIAN_BUILTINS();
+
if (TARGET_LONG_DOUBLE_128)
builtin_define ("__LONG_DOUBLE_128__");
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 5771a9c..ab38f56 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -479,6 +479,26 @@ extern int rs6000_default_long_calls;
/* Target #defines. */
#define TARGET_CPU_CPP_BUILTINS() \
rs6000_cpu_cpp_builtins (pfile)
+
+/* This is used by rs6000_cpu_cpp_builtins to indicate the byte order
+ we're compiling for. Some configurations may need to override it. */
+#define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
+ do \
+ { \
+ if (BYTES_BIG_ENDIAN) \
+ { \
+ builtin_define ("__BIG_ENDIAN__"); \
+ builtin_define ("_BIG_ENDIAN"); \
+ builtin_assert ("machine=bigendian"); \
+ } \
+ else \
+ { \
+ builtin_define ("__LITTLE_ENDIAN__"); \
+ builtin_define ("_LITTLE_ENDIAN"); \
+ builtin_assert ("machine=littleendian"); \
+ } \
+ } \
+ while (0)
/* Target machine storage layout. */