aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-30 13:39:33 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-30 13:39:33 +0000
commit352b62b26b18d3a41adb25c94d78c9303775b700 (patch)
treedd84ac123ec7885309e8c16070d77689d45f3969
parent75922898bd25580a0553e3a5f6716a59ab9b5b03 (diff)
* config.gcc (m68k-*-aout*, m68k-*-coff*, m68020-*-elf*, m68k-*-elf*, m68010-*-netbsdelf*, m68k*-*-netbsdelf*, m68k*-*-openbsd*, m68k-*-rtems*): Use tm_file rather than m68k/m68k.h and explicitly set MOTOROLA to 1. m68k-*-uclinux*, m68k-*-linux*): Place m68k/m68k.h last, define MOTOROLA to 1, remove obsolete comments. * config/m68k/linux.h (TARGET_VERSION): Don't undef here. (ASM_SPEC): Replace with ... (SUBTARGET_ASM_SPEC): ... this. Remove unneeded %{Wa,*:%*} spec. (REGISTER_PREFIX, LOCAL_LABEL_PREFIX, USER_LABEL_PREFIX, SIZE_TYPE, CPP_SPEC, ASM_OUTPUT_ALIGN, FUNCTION_PROFILER, FUNCTION_VALUE_REGNO_P, NEEDS_UNTYPED_CALL, FUNCTION_VALUE, LIBCALL_VALUE): Remove undefs prior to setting them. (WCHAR_TYPE, WCHAR_TYPE_SIZE, SIZE_TYPE, PTR_DIFFTYPE, DBX_REGISTER_NUMBER): Remove definitions, the defaults are ok. (TARGET_ASM_FILE_START_APP_OFF): Explicitly define to false * config/m68k/m68k-none.h: Remove obsolete MULTILIB_DEFAULTS comment. (ASM_SPEC): Replace with ... (SUBTARGET_ASM_SPEC): ... this. * config/m68k/openbsd.h (ASM_SPEC): Replace with ... (SUBTARGET_ASM_SPEC): ... this. * config/m68k/m68k.h (MOTOROLA): Expect to be defined to a value, if defined. (ASM_CPU_SPEC, SUBTARGET_ASM_SPEC): New. (ASM_SPEC): Define. (EXTRA_SPECS): Add asm_cpu_spec, subtarget_asm_spec. (CPP_SUBTARGET_SPEC): Remove. (WCHAR_TYPE_SIZE): Set to BITS_PER_WORD. (STACK_GROWS_DOWNWARD): Set to 1. (SUBTARGET_EXTRA_SPECS): Remove. (TARGET_VERSION, FUNCTION_VALUE, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P, NEEDS_UNTYPED_CALL, FUNCTION_PROFILER, M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P, REGISTER_PREFIX, LOCAL_LABEL_PREFIX, TARGET_ASM_FILE_START_APP_OFF, ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_ALIGN, ASM_OUTPUT_SKIP): Add protective #ifndefs * config/m68k/uclinux.h (M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P): Unconditionally define. gcc/ * config/m68k/m68k.h (REGISTER_MOVE_COST): Simplify. (RETURN_POPS_ARGS): Reformat to avoid long line. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/csl/sourcerygxx-4_1@118180 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog.csl46
-rw-r--r--gcc/config.gcc43
-rw-r--r--gcc/config/m68k/linux.h53
-rw-r--r--gcc/config/m68k/m68k-none.h29
-rw-r--r--gcc/config/m68k/m68k.h86
-rw-r--r--gcc/config/m68k/openbsd.h5
-rw-r--r--gcc/config/m68k/uclinux.h1
7 files changed, 144 insertions, 119 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl
index 5e3ce4dda64..9f0644434b7 100644
--- a/ChangeLog.csl
+++ b/ChangeLog.csl
@@ -1,3 +1,49 @@
+2006-10-30 Nathan Sidwell <nathan@codesourcery.com>
+
+ gcc/
+ * config.gcc (m68k-*-aout*, m68k-*-coff*, m68020-*-elf*,
+ m68k-*-elf*, m68010-*-netbsdelf*, m68k*-*-netbsdelf*,
+ m68k*-*-openbsd*, m68k-*-rtems*): Use tm_file rather than
+ m68k/m68k.h and explicitly set MOTOROLA to 1.
+ m68k-*-uclinux*, m68k-*-linux*): Place m68k/m68k.h last, define
+ MOTOROLA to 1, remove obsolete comments.
+ * config/m68k/linux.h (TARGET_VERSION): Don't undef here.
+ (ASM_SPEC): Replace with ...
+ (SUBTARGET_ASM_SPEC): ... this. Remove unneeded %{Wa,*:%*} spec.
+ (REGISTER_PREFIX, LOCAL_LABEL_PREFIX, USER_LABEL_PREFIX,
+ SIZE_TYPE, CPP_SPEC, ASM_OUTPUT_ALIGN, FUNCTION_PROFILER,
+ FUNCTION_VALUE_REGNO_P, NEEDS_UNTYPED_CALL, FUNCTION_VALUE,
+ LIBCALL_VALUE): Remove undefs prior to setting them.
+ (WCHAR_TYPE, WCHAR_TYPE_SIZE, SIZE_TYPE, PTR_DIFFTYPE,
+ DBX_REGISTER_NUMBER): Remove definitions, the defaults are ok.
+ (TARGET_ASM_FILE_START_APP_OFF): Explicitly define to false
+ * config/m68k/m68k-none.h: Remove obsolete MULTILIB_DEFAULTS comment.
+ (ASM_SPEC): Replace with ...
+ (SUBTARGET_ASM_SPEC): ... this.
+ * config/m68k/openbsd.h (ASM_SPEC): Replace with ...
+ (SUBTARGET_ASM_SPEC): ... this.
+ * config/m68k/m68k.h (MOTOROLA): Expect to be defined to a value,
+ if defined.
+ (ASM_CPU_SPEC, SUBTARGET_ASM_SPEC): New.
+ (ASM_SPEC): Define.
+ (EXTRA_SPECS): Add asm_cpu_spec, subtarget_asm_spec.
+ (CPP_SUBTARGET_SPEC): Remove.
+ (WCHAR_TYPE_SIZE): Set to BITS_PER_WORD.
+ (STACK_GROWS_DOWNWARD): Set to 1.
+ (SUBTARGET_EXTRA_SPECS): Remove.
+ (TARGET_VERSION, FUNCTION_VALUE,
+ LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P, NEEDS_UNTYPED_CALL,
+ FUNCTION_PROFILER, M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P,
+ REGISTER_PREFIX, LOCAL_LABEL_PREFIX,
+ TARGET_ASM_FILE_START_APP_OFF, ASM_GENERATE_INTERNAL_LABEL,
+ ASM_OUTPUT_ALIGN, ASM_OUTPUT_SKIP): Add protective #ifndefs
+ * config/m68k/uclinux.h (M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P):
+ Unconditionally define.
+
+ gcc/
+ * config/m68k/m68k.h (REGISTER_MOVE_COST): Simplify.
+ (RETURN_POPS_ARGS): Reformat to avoid long line.
+
2006-10-30 Julian Brown <julian@codesourcery.com>
gcc/
diff --git a/gcc/config.gcc b/gcc/config.gcc
index f694074a22f..d9b88517bca 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1444,23 +1444,23 @@ m68hc12-*-*|m6812-*-*)
;;
m68k-*-aout*)
tmake_file="m68k/t-m68kbare m68k/t-mlib-matches"
- tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kemb.h m68k/m68k-aout.h libgloss.h"
+ tm_file="${tm_file} m68k/m68k-none.h m68k/m68kemb.h m68k/m68k-aout.h libgloss.h"
;;
m68k-*-coff*)
tmake_file="m68k/t-m68kbare m68k/t-mlib-matches"
- tm_defines="${tm_defines} MOTOROLA USE_GAS"
- tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kemb.h dbxcoff.h m68k/coff.h dbx.h"
+ tm_defines="${tm_defines} MOTOROLA=1 USE_GAS"
+ tm_file="${tm_file} m68k/m68k-none.h m68k/m68kemb.h dbxcoff.h m68k/coff.h dbx.h"
use_fixproto=yes
;;
m68020-*-elf* | m68k-*-elf*)
- tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h"
- tm_defines="${tm_defines} MOTOROLA USE_GAS"
+ tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h"
+ tm_defines="${tm_defines} MOTOROLA=1 USE_GAS"
tmake_file="m68k/t-m68kelf m68k/t-mlib-matches"
extra_parts="crtbegin.o crtend.o"
;;
m68010-*-netbsdelf* | m68k*-*-netbsdelf*)
tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h m68k/netbsd-elf.h"
- tm_defines="${tm_defines} MOTOROLA USE_GAS"
+ tm_defines="${tm_defines} MOTOROLA=1 USE_GAS"
case ${target} in
m68010*)
target_cpu_default="0"
@@ -1473,37 +1473,30 @@ m68010-*-netbsdelf* | m68k*-*-netbsdelf*)
m68k*-*-openbsd*)
# needed to unconfuse gdb
tm_defines="${tm_defines} OBSD_OLD_GAS TARGET_DEFAULT=(MASK_68020|MASK_68881|MASK_BITFIELD)"
- tm_file="m68k/m68k.h openbsd.h m68k/openbsd.h"
+ tm_file="${tm_file} openbsd.h m68k/openbsd.h"
tmake_file="t-libc-ok t-openbsd m68k/t-openbsd m68k/t-mlib-matches"
# we need collect2 until our bug is fixed...
use_collect2=yes
;;
-m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux with uClibc
- tm_file="m68k/m68k.h dbxelf.h elfos.h svr4.h linux.h flat.h m68k/linux.h m68k/uclinux.h ./sysroot-suffix.h"
- tm_defines="${tm_defines} MOTOROLA USE_GAS UCLIBC_DEFAULT=1"
- extra_options="${extra_options} linux.opt"
- tmake_file="m68k/t-uclinux m68k/t-mlib-matches"
- use_fixproto=no
- ;;
m68k-*-linux*) # Motorola m68k's running GNU/Linux
- # with ELF format using glibc 2
- # aka the GNU/Linux C library 6.
- tm_file="m68k/m68k.h dbxelf.h elfos.h svr4.h linux.h m68k/linux.h"
+ tm_file="dbxelf.h elfos.h svr4.h linux.h m68k/linux.h ${tm_file}"
extra_options="${extra_options} m68k/ieee.opt"
- tm_defines="${tm_defines} MOTOROLA USE_GAS"
+ tm_defines="${tm_defines} MOTOROLA=1 USE_GAS"
tmake_file="${tmake_file} m68k/t-linux m68k/t-mlib-matches"
- # if not configured with --enable-sjlj-exceptions, bump the
- # libgcc version number
-# if test x$sjlj != x1; then
-# tmake_file="$tmake_file m68k/t-slibgcc-elf-ver"
-# fi
;;
m68k-*-rtems*)
tmake_file="m68k/t-m68kbare m68k/t-mlib-matches m68k/t-crtstuff t-rtems m68k/t-rtems"
- tm_file="m68k/m68k-none.h m68k/m68k.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h"
- tm_defines="${tm_defines} MOTOROLA USE_GAS"
+ tm_file="m68k/m68k-none.h ${tm_file} m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h"
+ tm_defines="${tm_defines} MOTOROLA=1 USE_GAS"
extra_parts="crtbegin.o crtend.o"
;;
+m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux with uClibc
+ tm_file="dbxelf.h elfos.h svr4.h linux.h flat.h m68k/linux.h m68k/uclinux.h ${tm_file} ./sysroot-suffix.h"
+ tm_defines="${tm_defines} MOTOROLA=1 USE_GAS UCLIBC_DEFAULT=1"
+ extra_options="${extra_options} linux.opt"
+ tmake_file="m68k/t-uclinux m68k/t-mlib-matches"
+ use_fixproto=no
+ ;;
mcore-*-elf)
tm_file="dbxelf.h elfos.h svr4.h ${tm_file} mcore/mcore-elf.h"
tmake_file=mcore/t-mcore
diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h
index 99b8de22853..93de1235b29 100644
--- a/gcc/config/m68k/linux.h
+++ b/gcc/config/m68k/linux.h
@@ -20,7 +20,6 @@ along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
-#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (68k GNU/Linux with ELF)");
/* Default to m68040. */
@@ -29,22 +28,12 @@ Boston, MA 02110-1301, USA. */
#define ASM_CPU_DEFAULT_SPEC "-mcpu=68040"
#endif
-/* We override the ASM_SPEC from svr4.h because we must pass the right
- cpu option to the assembler. This can go away when we require the
- assembler to suppor the .cpu directive. */
+/* ASM_SPEC is set in m68k.h, so we have to set SUBTARGET_ASM_SPEC to
+ the svr4.h options. We have to undef ASM_SPEC here, so that m68k.h
+ does not complain. */
#undef ASM_SPEC
-#define ASM_SPEC \
- "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
-%{m68851}%{mno-68851}%{m68881}%{mno-68881}%{msoft-float:-mno-float}\
-%{m68000}%{m68302}%{mc68000}%{m68010}%{m68020}%{mc68020}%{m68030}\
-%{m68040}%{m68020-40:-m68040} %{m68020-60:-m68040}\
-%{m68060}%{mcpu32}%{m68332}%{m5200}%{m5206e}%{m528x}%{m5307}%{m5407}%{mcfv4e}\
-%{mcpu=*:-mcpu=%*}\
-%{march=*:-march=%*}\
-%{!mc68000:%{!m68000:%{!m68302:%{!m68010:%{!mc68020:%{!m68020:\
- %{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32:\
- %{!m68332:%{!m5200:%{!m5206e:%{!m528x:%{!m5307:%{!m5407:%{!mcfv4e:\
- %{!mcpu=*:%{!march=*:%(asm_cpu_default)}}}}}}}}}}}}}}}}}}}}}"
+#define SUBTARGET_ASM_SPEC \
+ "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*}"
/* Here are four prefixes that are used by asm_fprintf to
facilitate customization for alternate assembler syntaxes.
@@ -55,34 +44,19 @@ Boston, MA 02110-1301, USA. */
is supposed to include this prefix. Also note that this is NOT an
fprintf format string, it is a literal string */
-#undef REGISTER_PREFIX
#define REGISTER_PREFIX "%"
/* The prefix for local (compiler generated) labels.
These labels will not appear in the symbol table. */
-#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
/* The prefix to add to user-visible assembler symbols. */
-#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX ""
#define ASM_COMMENT_START "|"
-#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
-
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "int"
-
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "long int"
-
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE BITS_PER_WORD
-
/* Target OS builtins. */
#define TARGET_OS_CPP_BUILTINS() \
do \
@@ -98,7 +72,6 @@ Boston, MA 02110-1301, USA. */
} \
while (0)
-#undef CPP_SPEC
#define CPP_SPEC \
"%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
@@ -120,7 +93,7 @@ Boston, MA 02110-1301, USA. */
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
-#undef LINK_SPEC
+#undef LINK_SPEC
#define LINK_SPEC "-m m68kelf %{shared} \
%{!shared: \
%{!static: \
@@ -155,7 +128,6 @@ Boston, MA 02110-1301, USA. */
/* This is how to output an assembler line that says to advance the
location counter to a multiple of 2**LOG bytes. */
-#undef ASM_OUTPUT_ALIGN
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
if ((LOG) > 0) \
fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG));
@@ -177,7 +149,6 @@ Boston, MA 02110-1301, USA. */
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */
-#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO)); \
@@ -187,12 +158,6 @@ Boston, MA 02110-1301, USA. */
fprintf (FILE, "\tjbsr _mcount\n"); \
}
-/* How to renumber registers for dbx and gdb.
- On the Sun-3, the floating point registers have numbers
- 18 to 25, not 16 to 23 as they do in the compiler. */
-
-#define DBX_REGISTER_NUMBER(REGNO) ((REGNO) < 16 ? (REGNO) : (REGNO) + 2)
-
/* Do not break .stabs pseudos into continuations. */
#define DBX_CONTIN_LENGTH 0
@@ -202,14 +167,12 @@ Boston, MA 02110-1301, USA. */
pointer, or floating types, respectively. Reject fp0 if not using
a 68881 coprocessor. */
-#undef FUNCTION_VALUE_REGNO_P
#define FUNCTION_VALUE_REGNO_P(N) \
((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16))
/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for
more than one register. */
-#undef NEEDS_UNTYPED_CALL
#define NEEDS_UNTYPED_CALL 1
/* Define how to generate (in the callee) the output value of a
@@ -219,7 +182,6 @@ Boston, MA 02110-1301, USA. */
FUNCTION_DECL; otherwise, FUNC is 0. For m68k/SVR4 generate the
result in d0, a0, or fp0 as appropriate. */
-#undef FUNCTION_VALUE
#define FUNCTION_VALUE(VALTYPE, FUNC) \
m68k_function_value (VALTYPE, FUNC)
@@ -228,7 +190,6 @@ Boston, MA 02110-1301, USA. */
For m68k/SVR4 look for integer values in d0, pointer values in d0
(returned in both d0 and a0), and floating values in fp0. */
-#undef LIBCALL_VALUE
#define LIBCALL_VALUE(MODE) \
m68k_libcall_value (MODE)
@@ -276,6 +237,6 @@ Boston, MA 02110-1301, USA. */
/* glibc uses comments to hide section attributes. So setting
ASM_FILE_START_APP_OFF breaks it. */
-#undef TARGET_ASM_FILE_START_APP_OFF
+#define TARGET_ASM_FILE_START_APP_OFF false
#define MD_UNWIND_SUPPORT "config/m68k/linux-unwind.h"
diff --git a/gcc/config/m68k/m68k-none.h b/gcc/config/m68k/m68k-none.h
index 53a067f73c3..e15dfe43b8a 100644
--- a/gcc/config/m68k/m68k-none.h
+++ b/gcc/config/m68k/m68k-none.h
@@ -25,23 +25,9 @@ Boston, MA 02110-1301, USA. */
#define ASM_CPU_DEFAULT_SPEC "-mcpu=68020"
#endif
-/* Pass flags to gas indicating which type of processor we have. This
- can be simplified when we can rely on the assembler supporting .cpu
- and .arch directives. */
-
-#undef ASM_SPEC
-#define ASM_SPEC "\
-%{m68851}%{mno-68851} %{m68881}%{mno-68881} %{msoft-float:-mno-float} \
-%{m68000}%{m68302}%{mc68000}%{m68010}%{m68020}%{mc68020}%{m68030}\
-%{m68040}%{m68020-40:-m68040}%{m68020-60:-m68040}\
-%{m68060}%{mcpu32}%{m68332}%{m5200}%{m5206e}%{m528x}%{m5307}%{m5407}%{mcfv4e}\
-%{mcpu=*:-mcpu=%*}%{march=*:-march=%*}\
-%{!mc68000:%{!m68000:%{!m68302:%{!m68010:%{!mc68020:%{!m68020:\
-%{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32:\
-%{!m68332:%{!m5200:%{!m5206e:%{!m528x:%{!m5307:%{!m5407:%{!mcfv4e:\
-%{!mcpu=*:%{!march=*:%(asm_cpu_default)}}}}}}}}}}}}}}}}}}}}} \
-%{fPIC:--pcrel} %{fpic:--pcrel} %{msep-data:--pcrel}\
-%{mid-shared-library:--pcrel}"
+#undef SUBTARGET_ASM_SPEC
+#define SUBTARGET_ASM_SPEC "%{fPIC:--pcrel} %{fpic:--pcrel} \
+ %{msep-data:--pcrel} %{mid-shared-library:--pcrel}"
/* cc1/cc1plus always receives all the -m flags. If the specs strings above
are consistent with the flags in m68k.opt, there should be no need for
@@ -49,12 +35,3 @@ Boston, MA 02110-1301, USA. */
#undef CC1_SPEC
#define CC1_SPEC ""
-
-
-/* Avoid building multilib libraries for the defaults.
- For targets not handled here, just build the full set of multilibs.
- The default is m68k 99.9% of the time anyway. */
-
-/* FIXME: Re-implement behaviour described above.
-
-#define MULTILIB_DEFAULTS ... */
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index 22bcdceefab..2d47ad1fe78 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -23,13 +23,15 @@ Boston, MA 02110-1301, USA. */
if-statements and ?: on it. This way we have compile-time error checking
for both the MOTOROLA and MIT code paths. We do rely on the host compiler
to optimize away all constant tests. */
-#ifdef MOTOROLA
-# undef MOTOROLA
-# define MOTOROLA 1 /* Use the Motorola assembly syntax. */
-# define TARGET_VERSION fprintf (stderr, " (68k, Motorola syntax)")
+#if MOTOROLA /* Use the Motorola assembly syntax. */
+# ifndef TARGET_VERSION
+# define TARGET_VERSION fprintf (stderr, " (68k, Motorola syntax)")
+# endif
#else
-# define TARGET_VERSION fprintf (stderr, " (68k, MIT syntax)")
# define MOTOROLA 0 /* Use the MIT assembly syntax. */
+# ifndef TARGET_VERSION
+# define TARGET_VERSION fprintf (stderr, " (68k, MIT syntax)")
+# endif
#endif
/* Handle --with-cpu, --with-float default options from configure script. */
@@ -45,11 +47,37 @@ Boston, MA 02110-1301, USA. */
#define TARGET_DEFAULT 0
#endif
-
#ifndef ASM_CPU_DEFAULT_SPEC
#define ASM_CPU_DEFAULT_SPEC ""
#endif
+
+/* Pass flags to gas indicating which type of processor we have. This
+ can be simplified when we can rely on the assembler supporting .cpu
+ and .arch directives. */
+
+#define ASM_CPU_SPEC "\
+%{m68851}%{mno-68851} %{m68881}%{mno-68881} %{msoft-float:-mno-float} \
+%{m68000}%{m68302}%{mc68000}%{m68010}%{m68020}%{mc68020}%{m68030}\
+%{m68040}%{m68020-40:-m68040}%{m68020-60:-m68040}\
+%{m68060}%{mcpu32}%{m68332}%{m5200}%{m5206e}%{m528x}%{m5307}%{m5407}%{mcfv4e}\
+%{mcpu=*:-mcpu=%*}%{march=*:-march=%*}\
+%{!mc68000:%{!m68000:%{!m68302:%{!m68010:%{!mc68020:%{!m68020:\
+%{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32:\
+%{!m68332:%{!m5200:%{!m5206e:%{!m528x:%{!m5307:%{!m5407:%{!mcfv4e:\
+%{!mcpu=*:%{!march=*:%(asm_cpu_default)}}}}}}}}}}}}}}}}}}}}} \
+"
+
+/* SUBTARGET_ASM_SPEC is always passed to the assembler. It may be
+ overridden by subtargets. */
+#ifndef SUBTARGET_ASM_SPEC
+#define SUBTARGET_ASM_SPEC ""
+#endif
+
+/* We do not #undef this beforehand in order to detect it being
+ erronously #defined. */
+#define ASM_SPEC "%(asm_cpu_spec) %(subtarget_asm_spec)"
+
/* This macro defines names of additional specifications to put in the specs
that can be used in various specifications like CC1_SPEC. Its definition
is an initializer with a subgrouping for each command option.
@@ -62,10 +90,8 @@ Boston, MA 02110-1301, USA. */
#define EXTRA_SPECS \
{ "asm_cpu_default", ASM_CPU_DEFAULT_SPEC }, \
- SUBTARGET_EXTRA_SPECS
-
-#define CPP_SUBTARGET_SPEC ""
-#define SUBTARGET_EXTRA_SPECS
+ { "asm_cpu_spec", ASM_CPU_SPEC }, \
+ { "subtarget_asm_spec", SUBTARGET_ASM_SPEC } \
/* Note that some other tm.h files include this one and then override
many of the definitions that relate to assembler syntax. FIXME:We
@@ -540,13 +566,11 @@ extern enum reg_class regno_reg_class[];
/* Moves between fp regs and other regs are two insns. */
#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \
- (((CLASS1) == FP_REGS && (CLASS2) != FP_REGS) \
- || ((CLASS2) == FP_REGS && (CLASS1) != FP_REGS) \
- ? 4 : 2)
+ ((((CLASS1) == FP_REGS) != ((CLASS2) == FP_REGS)) ? 4 : 2)
/* Stack layout; function entry, exit and calling. */
-#define STACK_GROWS_DOWNWARD
+#define STACK_GROWS_DOWNWARD 1
#define FRAME_GROWS_DOWNWARD 1
#define STARTING_FRAME_OFFSET 0
@@ -565,26 +589,34 @@ extern enum reg_class regno_reg_class[];
standard Unix calling sequences. If the option is not selected,
the caller must always pop the args. */
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
- ((TARGET_RTD && (!(FUNDECL) || TREE_CODE (FUNDECL) != IDENTIFIER_NODE) \
+ ((TARGET_RTD && (!(FUNDECL) || TREE_CODE (FUNDECL) != IDENTIFIER_NODE) \
&& (TYPE_ARG_TYPES (FUNTYPE) == 0 \
|| (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \
== void_type_node))) \
? (SIZE) : 0)
-/* On the m68k the return value is always in D0. */
+/* On the m68k the return value defaults to D0. */
+#ifndef FUNCTION_VALUE
#define FUNCTION_VALUE(VALTYPE, FUNC) \
gen_rtx_REG (TYPE_MODE (VALTYPE), 0)
+#endif
-/* On the m68k the return value is always in D0. */
+/* On the m68k the return value defaults to D0. */
+#ifndef LIBCALL_VALUE
#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0)
+#endif
-/* On the m68k, D0 is the only register used. */
+/* On the m68k, D0 is usually the only register used. */
+#ifndef FUNCTION_VALUE_REGNO_P
#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
+#endif
/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for
more than one register.
XXX This macro is m68k specific and used only for m68kemb.h. */
+#ifndef NEEDS_UNTYPED_CALL
#define NEEDS_UNTYPED_CALL 0
+#endif
/* On the m68k, all arguments are usually pushed on the stack. */
#define FUNCTION_ARG_REGNO_P(N) 0
@@ -605,8 +637,10 @@ extern enum reg_class regno_reg_class[];
/* On the m68k all args are always pushed. */
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
+#ifndef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
asm_fprintf (FILE, "\tlea %LLP%d,%Ra0\n\tjsr mcount\n", (LABELNO))
+#endif
#define EXIT_IGNORE_STACK 1
@@ -752,7 +786,9 @@ __transfer_from_trampoline () \
/* True if SYMBOL + OFFSET constants must refer to something within
SYMBOL's section. */
+#ifndef M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P
#define M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P 0
+#endif
#define MAX_REGS_PER_ADDRESS 2
@@ -912,11 +948,19 @@ do { if (cc_prev_status.flags & CC_IN_68881) \
#define TEXT_SECTION_ASM_OP "\t.text"
#define DATA_SECTION_ASM_OP "\t.data"
#define GLOBAL_ASM_OP "\t.globl\t"
+#ifndef REGISTER_PREFIX
#define REGISTER_PREFIX ""
+#endif
+#ifndef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX ""
+#endif
+#ifndef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX "_"
+#endif
#define IMMEDIATE_PREFIX "#"
+#ifndef TARGET_ASM_FILE_START_APP_OFF
#define TARGET_ASM_FILE_START_APP_OFF true
+#endif
#define REGISTER_NAMES \
{REGISTER_PREFIX"d0", REGISTER_PREFIX"d1", REGISTER_PREFIX"d2", \
@@ -1010,8 +1054,10 @@ do { if (cc_prev_status.flags & CC_IN_68881) \
#define ASM_OUTPUT_LABELREF(FILE,NAME) \
asm_fprintf (FILE, "%U%s", NAME)
+#ifndef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
sprintf (LABEL, "*%s%s%ld", LOCAL_LABEL_PREFIX, PREFIX, (long)(NUM))
+#endif
#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
asm_fprintf (FILE, "\tmovel %s,%Rsp@-\n", reg_names[REGNO])
@@ -1028,12 +1074,16 @@ do { if (cc_prev_status.flags & CC_IN_68881) \
/* We don't have a way to align to more than a two-byte boundary, so do the
best we can and don't complain. */
+#ifndef ASM_OUTPUT_ALIGN
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
if ((LOG) >= 1) \
fprintf (FILE, "\t.even\n");
+#endif
+#ifndef ASM_OUTPUT_SKIP
#define ASM_OUTPUT_SKIP(FILE,SIZE) \
fprintf (FILE, "\t.skip %u\n", (int)(SIZE))
+#endif
#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
( fputs (".comm ", (FILE)), \
diff --git a/gcc/config/m68k/openbsd.h b/gcc/config/m68k/openbsd.h
index eb0c13d2979..641f574c532 100644
--- a/gcc/config/m68k/openbsd.h
+++ b/gcc/config/m68k/openbsd.h
@@ -34,9 +34,8 @@ Boston, MA 02110-1301, USA. */
#undef CPP_SPEC
#define CPP_SPEC "%{!msoft-float:-D__HAVE_68881__ -D__HAVE_FPU__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
-/* m68k as needs to know about the processor subtype. */
-#undef ASM_SPEC
-#define ASM_SPEC "%{m68030} %{m68040} %{m68060} %{fpic|fpie:-k} %{fPIC|fPIE:-k -K}"
+#undef SUBTARGET_ASM_SPEC
+#define SUBTARGET_ASM_SPEC "%{fpic|fpie:-k} %{fPIC|fPIE:-k -K}"
#define AS_NEEDS_DASH_FOR_PIPED_INPUT
diff --git a/gcc/config/m68k/uclinux.h b/gcc/config/m68k/uclinux.h
index 0ce0b307e40..78ba3037d49 100644
--- a/gcc/config/m68k/uclinux.h
+++ b/gcc/config/m68k/uclinux.h
@@ -61,7 +61,6 @@ Boston, MA 02110-1301, USA. */
/* The uclinux binary format relies on relocations against a segment being
within that segment. Conservatively apply this rule to individual
sections. */
-#undef M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P
#define M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P 1
/* -msep-data is the default PIC mode on this target. */