aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2002-03-08 05:59:25 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2002-03-08 05:59:25 +0000
commit5faae4f77908932c7a11ecfc0e59bc6321f68cd5 (patch)
tree4adb9294b1eedf9db3b6e3200165c151be2eca61
parent8a13c09297c2784bdf7628a54e74c0a845bc65d3 (diff)
downloadgcc-5faae4f77908932c7a11ecfc0e59bc6321f68cd5.zip
gcc-5faae4f77908932c7a11ecfc0e59bc6321f68cd5.tar.gz
gcc-5faae4f77908932c7a11ecfc0e59bc6321f68cd5.tar.bz2
mips.h (LONG_MAX_SPEC): Rewrite, along with SUBTARGET_CPP_SIZE_SPEC.
* config/mips/mips.h (LONG_MAX_SPEC): Rewrite, along with SUBTARGET_CPP_SIZE_SPEC. * config/mips/abi64.h (LONG_MAX_SPEC): Delete. From-SVN: r50425
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/mips/abi64.h21
-rw-r--r--gcc/config/mips/mips.h42
3 files changed, 37 insertions, 30 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index eabbbbc..254d804 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2002-03-08 Alexandre Oliva <aoliva@redhat.com>
+ * config/mips/mips.h (LONG_MAX_SPEC): Rewrite, along with
+ SUBTARGET_CPP_SIZE_SPEC.
+ * config/mips/abi64.h (LONG_MAX_SPEC): Delete.
+
* config/mips/mips.h (SUBTARGET_CPP_SIZE_SPEC): Simplify.
2002-03-07 Alexandre Oliva <aoliva@redhat.com>
diff --git a/gcc/config/mips/abi64.h b/gcc/config/mips/abi64.h
index 13581a3..43887d5 100644
--- a/gcc/config/mips/abi64.h
+++ b/gcc/config/mips/abi64.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler. 64 bit ABI support.
- Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -214,25 +214,6 @@ Boston, MA 02111-1307, USA. */
(mips_abi == ABI_EABI && (NAMED) \
&& FUNCTION_ARG_PASS_BY_REFERENCE (CUM, MODE, TYPE, NAMED))
-/* Define LONG_MAX correctly for all users. We need to handle 32 bit EABI,
- 64 bit EABI, N32, and N64 as possible defaults. The checks performed here
- are the same as the checks in override_options in mips.c that determines
- whether MASK_LONG64 will be set.
-
- This does not handle inappropriate options or ununusal option
- combinations. */
-
-#undef LONG_MAX_SPEC
-#if ((MIPS_ABI_DEFAULT == ABI_64) || ((MIPS_ABI_DEFAULT == ABI_EABI) && ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_64BIT)))
-#define LONG_MAX_SPEC \
- "%{!mabi=32:%{!mabi=n32:%{!mlong32:%{!mgp32:%{!mips1:%{!mips2:-D__LONG_MAX__=9223372036854775807L}}}}}}"
-#else
-#define LONG_MAX_SPEC \
- "%{mabi=64:-D__LONG_MAX__=9223372036854775807L} \
- %{mlong64:-D__LONG_MAX__=9223372036854775807L} \
- %{mgp64:-D__LONG_MAX__=9223372036854775807L}"
-#endif
-
/* ??? Unimplemented stuff follows. */
/* ??? Add support for 16 byte/128 bit long doubles here when
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 80d7dea..24c6e97 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -1060,6 +1060,23 @@ extern int mips_abi;
%{mgp64:%{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int}}} \
%{mabi=32:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
"
+#define LONG_MAX_SPEC "\
+%{mlong64:-D__LONG_MAX__=9223372036854775807L}\
+%{!mlong64:\
+ %{mabi=eabi|!mabi=*:\
+ %{!mips1:%{!mips2:%{!mips32:%{!mgp32:%{!mlong32: \
+ %{mips3|mips4|mips5|mips64|mgp64: \
+ -D__LONG_MAX__=9223372036854775807L}}}}}}}} \
+"
+#else /* ABI_DEFAULT != ABI_EABI */
+#define LONG_MAX_SPEC "\
+%{mlong64:-D__LONG_MAX__=9223372036854775807L}\
+%{!mlong64:\
+ %{mabi=eabi:\
+ %{!mips1:%{!mips2:%{!mips32:%{!mgp32:%{!mlong32: \
+ %{mips3|mips4|mips5|mips64|mgp64: \
+ -D__LONG_MAX__=9223372036854775807L}}}}}}}} \
+"
#endif
#if MIPS_ABI_DEFAULT == ABI_O64
@@ -1131,6 +1148,21 @@ extern int mips_abi;
%{!mgp32:%{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int}}} \
%{mabi=32:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
"
+#define LONG_MAX_SPEC "\
+%{mlong64:-D__LONG_MAX__=9223372036854775807L}\
+%{!mlong64:\
+ %{mabi=eabi|!mabi=*:\
+ %{!mips1:%{!mips2:%{!mips32:%{!mgp32:%{!mlong32: \
+ -D__LONG_MAX__=9223372036854775807L}}}}}}}\
+"
+#else /* ABI_DEFAULT != ABI_EABI */
+#define LONG_MAX_SPEC "\
+%{mlong64:-D__LONG_MAX__=9223372036854775807L}\
+%{!mlong64:\
+ %{mabi=eabi:\
+ %{!mips1:%{!mips2:%{!mips32:%{!mgp32:%{!mlong32: \
+ -D__LONG_MAX__=9223372036854775807L}}}}}}}\
+"
#endif
#if MIPS_ABI_DEFAULT == ABI_O64
@@ -1188,16 +1220,6 @@ extern int mips_abi;
#define SUBTARGET_CPP_SPEC ""
#endif
-/* If we're using 64bit longs, then we have to define __LONG_MAX__
- correctly. Similarly for 64bit ints and __INT_MAX__. */
-#ifndef LONG_MAX_SPEC
-#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_LONG64)
-#define LONG_MAX_SPEC "%{!mlong32:-D__LONG_MAX__=9223372036854775807L}"
-#else
-#define LONG_MAX_SPEC "%{mlong64:-D__LONG_MAX__=9223372036854775807L}"
-#endif
-#endif
-
/* Define appropriate macros for fpr register size. */
#ifndef CPP_FPR_SPEC
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_FLOAT64)