From 7ae3a63146f78af521163021e061d76826d52f07 Mon Sep 17 00:00:00 2001 From: coxs Date: Wed, 10 Apr 1996 21:52:00 +0000 Subject: [PATCH] Support EXTRA_SPECS git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11690 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/m88k/dgux.h | 65 +++++++++++++++++++++++++++++++++-------------- gcc/config/m88k/dguxbcs.h | 29 +++++++-------------- gcc/config/m88k/m88k.c | 47 +++++++++++++++++++++------------- gcc/config/m88k/m88k.h | 14 +++++----- gcc/config/m88k/m88k.md | 5 ++-- 5 files changed, 95 insertions(+), 65 deletions(-) diff --git a/gcc/config/m88k/dgux.h b/gcc/config/m88k/dgux.h index 807164e799e..3355c568886 100644 --- a/gcc/config/m88k/dgux.h +++ b/gcc/config/m88k/dgux.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. Motorola m88100 running DG/UX. - Copyright (C) 1988, 92, 93, 94, 1995 Free Software Foundation, Inc. + Copyright (C) 1988, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@mcc.com) Currently maintained by (gcc@dg-rtp.dg.com) @@ -30,7 +30,7 @@ Boston, MA 02111-1307, USA. */ (TARGET_SVR4 ? DWARF_DEBUG : SDB_DEBUG) #ifndef VERSION_INFO2 -#define VERSION_INFO2 "$Revision: 1.18 $" +#define VERSION_INFO2 "$Revision: 1.20 $" #endif #ifndef NO_BUGS #define AS_BUG_IMMEDIATE_LABEL @@ -83,24 +83,12 @@ Boston, MA 02111-1307, USA. */ -traditional, or restricting include files to one specific source target, specify full DG/UX features. */ #undef CPP_SPEC -#define CPP_SPEC "%{!m88000:%{!m88100:%{m88110:-D__m88110__}}} \ - %{!m88000:%{!m88110:%{m88100:-D__m88100__}}} \ - %{!ansi:%{!traditional:-D__OPEN_NAMESPACE__}} \ +#define CPP_SPEC "%(cpp_cpu) %{msvr3:-D_M88KBCS_TARGET} %{!msvr3:-D_DGUX_TARGET}" /* Assembler support (-V, silicon filter, legends for mxdb). */ #undef ASM_SPEC -#define ASM_SPEC "\ -%{V} %{v:%{!V:-V}} %{pipe:%{!.s: - }\ -%{!msvr3:%{!m88110:-KV3 }%{m88110:-KV04.00 }}}\ -%{g:\ -%{mno-legend:-Wc,off}\ -%{!mno-legend:-Wc,-fix-bb,-s\"%i\"\ -%{traditional:,-lc}%{!traditional:,-lansi-c}\ -%{mstandard:,-keep-std}\ -%{mkeep-coff:,-keep-coff}\ -%{mexternal-legend:,-external}\ -%{mocs-frame-position:,-ocs}}}" +#define ASM_SPEC "%(asm_cpu) %{!msvr3:%{!m88110:-KV3 }%{m88110:-KV04.00 }}}" /* Override svr4.h. */ #undef ASM_FINAL_SPEC @@ -126,14 +114,53 @@ Boston, MA 02111-1307, USA. */ %{symbolic:-Bsymbolic -G -dy} \ %{pg:-L/usr/lib/libp}%{p:-L/usr/lib/libp}" #undef STARTFILE_SPEC -#define STARTFILE_SPEC "%{!shared:%{!symbolic:%{pg:gcrt0.o%s} \ +#define STARTFILE_SPEC "%(startfile_default)" + + +/* 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. + + Each subgrouping contains a string constant, that defines the + specification name, and a string constant that used by the GNU CC driver + program. + + Do not define this macro if it does not need to do anything. */ + +#define EXTRA_SPECS \ + { "cpp_cpu", CPP_CPU_SPEC }, \ + { "asm_cpu", ASM_CPU_SPEC }, \ + { "startfile_default", STARTFILE_DEFAULT_SPEC }, \ + { "startfile_crtbegin", STARTFILE_CRTBEGIN_SPEC } + +#define ASM_CPU_SPEC "\ + %{V} %{v:%{!V:-V}} + %{g:\ + %{mno-legend:-Wc,off}\ + %{!mno-legend:-Wc,-fix-bb,-s\"%i\"\ + %{traditional:,-lc}\ + %{!traditional:,-lansi-c}\ + %{mstandard:,-keep-std}\ + %{mexternal-legend:,-external}\ + %{mocs-frame-position:,-ocs}}}" + +#define CPP_CPU_SPEC "\ + %{!m88000:%{!m88100:%{m88110:-D__m88110__}}} \ + %{!m88000:%{!m88110:%{m88100:-D__m88100__}}} \ + %{!ansi:%{!traditional:-D__OPEN_NAMESPACE__}}" + +#define STARTFILE_DEFAULT_SPEC "\ + %{!shared:%{!symbolic:%{pg:gcrt0.o%s} \ %{!pg:%{p:/lib/mcrt0.o}%{!p:/lib/crt0.o}} \ - %{msvr3:m88kdgux.ld%s bcscrtbegin.o%s} \ - %{!msvr3:crtbegin.o%s} \ + %(startfile_crtbegin) %{svr4:%{ansi:/lib/values-Xc.o} \ %{!ansi:%{traditional:/lib/values-Xt.o} \ %{!traditional:/usr/lib/values-Xa.o}}}}}" +#define STARTFILE_CRTBEGIN_SPEC "\ + %{msvr3:m88kdgux.ld%s bcscrtbegin.o%s} \ + %{!msvr3:crtbegin.o%s}" + #undef GPLUSPLUS_INCLUDE_DIR #define GPLUSPLUS_INCLUDE_DIR "/usr/opt/g++/lib/g++-include" diff --git a/gcc/config/m88k/dguxbcs.h b/gcc/config/m88k/dguxbcs.h index 45f288bf76e..24526565669 100644 --- a/gcc/config/m88k/dguxbcs.h +++ b/gcc/config/m88k/dguxbcs.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. Motorola m88100 running DG/UX. - Copyright (C) 1988, 89, 90, 91, 93, 94, 1995 Free Software Foundation, Inc. + Copyright (C) 1988, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@mcc.com) Currently maintained by (gcc@dg-rtp.dg.com) @@ -36,36 +36,25 @@ Boston, MA 02111-1307, USA. */ /* Assembler support (-V, silicon filter, legends for mxdb). */ #undef ASM_SPEC -#define ASM_SPEC "\ -%{V} %{v:%{!V:-V}} %{pipe:%{!.s: - }\ -%{msvr4:%{!m88110:-KV3 }%{m88110:-KV04.00 }}}\ -%{!mlegend:%{mstandard:-Wc,off}}\ -%{mlegend:-Wc,-fix-bb,-s\"%i\"\ -%{traditional:,-lc}%{!traditional:,-lansi-c}\ -%{mstandard:,-keep-std}\ -%{mkeep-coff:,-keep-coff}\ -%{mexternal-legend:,-external}\ -%{mocs-frame-position:,-ocs}}" +#define ASM_SPEC "%(asm_cpu) %{msvr4:%{!m88110:-KV3 }%{m88110:-KV04.00 }}}" /* If -m88100 is in effect, add -Dm88100; similarly for -m88110. Here, the CPU_DEFAULT is assumed to be -m88000. If not -ansi, -traditional, or restricting include files to one specific source target, specify full DG/UX features. */ #undef CPP_SPEC -#define CPP_SPEC "%{!m88000:%{!m88100:%{m88110:-D__m88110__}}} \ - %{!m88000:%{!m88110:%{m88100:-D__m88100__}}} \ - %{!ansi:%{!traditional:-D__OPEN_NAMESPACE__}} \ +#define CPP_SPEC "%(cpp_cpu) %{!msvr4:-D_M88KBCS_TARGET} %{msvr4:-D_DGUX_TARGET}" /* Linker and library spec's. -msvr3 is the default if -msvr4 is not specified. */ #undef LIB_SPEC #define LIB_SPEC "%{msvr4:%{!shared:-lstaticdgc}} %{!shared:%{!symbolic:-lc}}" + #undef STARTFILE_SPEC -#define STARTFILE_SPEC "%{!shared:%{!symbolic:%{pg:gcrt0.o%s} \ - %{!pg:%{p:/lib/mcrt0.o}%{!p:/lib/crt0.o}} \ +#define STARTFILE_SPEC "%(startfile_default)" + +#undef STARTFILE_CRTBEGIN_SPEC +#define STARTFILE_CRTBEGIN_SPEC "\ %{!msvr4:m88kdgux.ld%s bcscrtbegin.o%s} \ - %{msvr4:crtbegin.o%s} \ - %{svr4:%{ansi:/lib/values-Xc.o} \ - %{!ansi:%{traditional:/lib/values-Xt.o} \ - %{!traditional:/usr/lib/values-Xa.o}}}}}" + %{msvr4:crtbegin.o%s}" diff --git a/gcc/config/m88k/m88k.c b/gcc/config/m88k/m88k.c index ee7c02a304b..fee0a67d378 100644 --- a/gcc/config/m88k/m88k.c +++ b/gcc/config/m88k/m88k.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for Motorola 88000. - Copyright (C) 1988, 92, 93, 94, 1995 Free Software Foundation, Inc. + Copyright (C) 1988, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@mcc.com) Currently maintained by (gcc@dg-rtp.dg.com) @@ -261,17 +261,17 @@ emit_move_sequence (operands, mode, scratch) /* Simplify the source if we need to. */ if (GET_CODE (operand1) != HIGH && immediate_operand (operand1, mode)) { - if (GET_CODE (operand1) != CONST_INT - && GET_CODE (operand1) != CONST_DOUBLE) - { - rtx temp = ((reload_in_progress || reload_completed) - ? operand0 : 0); - operands[1] = legitimize_address (flag_pic - && symbolic_address_p (operand1), - operand1, temp, scratch); - if (mode != SImode) - operands[1] = gen_rtx (SUBREG, mode, operands[1], 0); - } + if (GET_CODE (operand1) != CONST_INT + && GET_CODE (operand1) != CONST_DOUBLE) + { + rtx temp = ((reload_in_progress || reload_completed) + ? operand0 : 0); + operands[1] = legitimize_address (flag_pic + && symbolic_address_p (operand1), + operand1, temp, scratch); + if (mode != SImode) + operands[1] = gen_rtx (SUBREG, mode, operands[1], 0); + } } /* Now have insn-emit do whatever it normally does. */ @@ -1635,7 +1635,7 @@ output_ascii (file, opcode, max, p, size) fprintf (file, "\\%03o", c); num += 4; } - else if (c >= ' ' && c < 0177) + else if ((c >= ' ' && c < 0177) || (c == '\t')) { putc (c, file); num++; @@ -1646,7 +1646,6 @@ output_ascii (file, opcode, max, p, size) switch (c) { /* Some assemblers can't handle \a, \v, or \?. */ - case '\t': c = 't'; goto escape; case '\f': c = 'f'; goto escape; case '\b': c = 'b'; goto escape; case '\r': c = 'r'; goto escape; @@ -1933,6 +1932,9 @@ m88k_begin_prologue (stream, size) FILE *stream; int size; { + if (TARGET_OMIT_LEAF_FRAME_POINTER && ! quiet_flag && leaf_function_p ()) + fprintf (stderr, "$");\ + m88k_prologue_done = 1; /* it's ok now to put out ln directives */ } @@ -2041,6 +2043,17 @@ m88k_end_epilogue (stream, size) if (insn == 0 || GET_CODE (insn) != BARRIER) fprintf (stream, "\tjmp\t %s\n", reg_names[1]); + /* If the last insn is a barrier, and the insn before that is a call, + then add a nop instruction so that tdesc can walk the stack correctly + even though there is no epilogue. (Otherwise, the label for the + end of the tdesc region ends up at the start of the next function. */ + if (insn && GET_CODE (insn) == BARRIER) + { + insn = prev_nonnote_insn (insn); + if (insn && GET_CODE (insn) == CALL_INSN) + fprintf (stream, "\tor\t %s,%s,%s\n",reg_names[0],reg_names[0],reg_names[0]); + } + output_short_branch_defs (stream); fprintf (stream, "\n"); @@ -2476,12 +2489,12 @@ output_block_profiler (file, blockno) /* @@ Need to deal with PIC. I'm not sure what the requirements are on register usage, so I used r26/r27 to be safe. */ fprintf (file, "\tor.u\t %s,%s,%shi16(%s+%d)\n", reg_names[27], reg_names[0], - m88k_pound_sign, &block[1], 4 * blockno); + m88k_pound_sign, &block[1], 4 * blockno); fprintf (file, "\tld\t %s,%s,%slo16(%s+%d)\n", reg_names[26], reg_names[27], - m88k_pound_sign, &block[1], 4 * blockno); + m88k_pound_sign, &block[1], 4 * blockno); fprintf (file, "\taddu\t %s,%s,1\n", reg_names[26], reg_names[26]); fprintf (file, "\tst\t %s,%s,%slo16(%s+%d)\n", reg_names[26], reg_names[27], - m88k_pound_sign, &block[1], 4 * blockno); + m88k_pound_sign, &block[1], 4 * blockno); } /* Determine whether a function argument is passed in a register, and diff --git a/gcc/config/m88k/m88k.h b/gcc/config/m88k/m88k.h index a6d5525f2d5..69f8bacf9d7 100644 --- a/gcc/config/m88k/m88k.h +++ b/gcc/config/m88k/m88k.h @@ -1,9 +1,8 @@ /* Definitions of target machine for GNU compiler for Motorola m88100 in an 88open OCS/BCS environment. - Copyright (C) 1988, 89, 90, 91, 93, 94, 1995 Free Software Foundation, Inc. + Copyright (C) 1988, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) - Enhanced by Michael Meissner (meissner@cygnus.com) - Version 2 port by Tom Wood (twood@pets.sps.mot.com) + Currently maintained by (gcc@dg-rtp.dg.com) This file is part of GNU CC. @@ -197,15 +196,15 @@ extern char * reg_names[]; /* Print subsidiary information on the compiler version in use. Redefined in sysv4.h, and luna.h. */ -#define VERSION_INFO1 "88open OCS/BCS, " +#define VERSION_INFO1 "m88k, " #ifndef VERSION_INFO2 -#define VERSION_INFO2 "$Revision: 1.67 $" +#define VERSION_INFO2 "$Revision: 1.68 $" #endif #ifndef VERSION_STRING #define VERSION_STRING version_string #ifdef __STDC__ -#define TM_RCS_ID "@(#)" __FILE__ " $Revision: 1.67 $ " __DATE__ +#define TM_RCS_ID "@(#)" __FILE__ " $Revision: 1.68 $ " __DATE__ #else #define TM_RCS_ID "$What: <@(#) m88k.h,v 1.1.1.2.2.2> $" #endif /* __STDC__ */ @@ -295,6 +294,7 @@ extern char * reg_names[]; { "no-serialize-volatile", MASK_NO_SERIALIZE_VOLATILE }, \ { "serialize-volatile", -MASK_NO_SERIALIZE_VOLATILE }, \ { "omit-leaf-frame-pointer", MASK_OMIT_LEAF_FRAME_POINTER }, \ + { "no-omit-leaf-frame-pointer", -MASK_OMIT_LEAF_FRAME_POINTER }, \ SUBTARGET_SWITCHES \ /* Default switches */ \ { "", TARGET_DEFAULT }, \ @@ -361,6 +361,8 @@ extern char * reg_names[]; if (flag_pic) \ error ("-mshort-data-%s and PIC are incompatible", m88k_short_data); \ } \ + if (TARGET_OMIT_LEAF_FRAME_POINTER) /* keep nonleaf frame pointers */ \ + flag_omit_frame_pointer = 1; \ } while (0) /*** Storage Layout ***/ diff --git a/gcc/config/m88k/m88k.md b/gcc/config/m88k/m88k.md index dc5ff5b8ff8..bf5124b2244 100644 --- a/gcc/config/m88k/m88k.md +++ b/gcc/config/m88k/m88k.md @@ -1,8 +1,7 @@ ;;- Machine description for the Motorola 88000 for GNU C compiler -;; Copyright (C) 1988, 92, 93, 94, 1995 Free Software Foundation, Inc. +;;; Copyright (C) 1988, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. ;; Contributed by Michael Tiemann (tiemann@mcc.com) -;; Additional changes by Michael Meissner (meissner@osf.org) -;; Version 2 port by Tom Wood (twood@pets.sps.mot.com) +;; Currently maintained by (gcc@dg-rtp.dg.com) ;; This file is part of GNU CC. -- 2.11.0