--- gcc/config/m68k/m68kv4.h 2018/04/24 18:10:24 1.1 +++ gcc/config/m68k/m68kv4.h 2018/04/24 18:28:10 1.1.1.4 @@ -1,7 +1,7 @@ /* Target definitions for GNU compiler for mc680x0 running System V.4 - Copyright (C) 1991 Free Software Foundation, Inc. + Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation, Inc. - Written by Ron Guilmette (rfg@ncd.com) and Fred Fish (fnf@cygnus.com). + Written by Ron Guilmette (rfg@netcom.com) and Fred Fish (fnf@cygnus.com). This file is part of GNU CC. @@ -17,13 +17,20 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* Use SGS_* macros to control compilation in m68k.md */ #define SGS_SWITCH_TABLES /* Different switch table handling */ #include "m68k/sgs.h" /* The m68k/SVR4 assembler is SGS based */ + +/* The SGS assembler requires a special definition of + ASM_IDENTIFY_GCC. We combine the m68k/sgs.h and the svr4.h + definitions below. */ +#undef ASM_IDENTIFY_GCC + #include "svr4.h" /* Pick up the generic SVR4 macros */ /* See m68k.h. 7 means 68020 with 68881. */ @@ -32,6 +39,19 @@ the Free Software Foundation, 675 Mass A #define TARGET_DEFAULT (5 /*68020*/ + 2 /*68881*/) #endif +/* When using an SGS assembler, modify the name of the artificial label which + identifies this file as having been compiled with gcc, and the macro that + emits such a label in the assembly output, to use '%' rather than '.' */ + +#undef ASM_IDENTIFY_GCC +#define ASM_IDENTIFY_GCC(FILE) \ +do \ + { \ + if (write_symbols != DBX_DEBUG) \ + fputs ("gcc2_compiled%:\n", FILE); \ + } \ +while (0) + /* Override the definition of NO_DOLLAR_IN_LABEL in svr4.h, for special g++ assembler names. When this is defined, g++ uses embedded '.' characters and some m68k assemblers have problems with this. The @@ -54,7 +74,8 @@ the Free Software Foundation, 675 Mass A the m68k running svr4. __svr4__ is our extension. */ #define CPP_PREDEFINES \ - "-Dm68k -Dunix -D__svr4__ -Asystem(unix) -Acpu(m68k) -Amachine(m68k)" + "-Dm68k -Dunix -D__svr4__ -D__motorola__ \ + -Asystem(unix) -Asystem(svr4) -Acpu(m68k) -Amachine(m68k)" /* Test to see if the target includes a 68881 by default, and use CPP_SPEC to control whether or not __HAVE_68881__ is defined by default or not. @@ -139,7 +160,7 @@ the Free Software Foundation, 675 Mass A #define FUNCTION_VALUE(VALTYPE, FUNC) \ (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \ ? gen_rtx (REG, TYPE_MODE (VALTYPE), 16) \ - : (TREE_CODE (VALTYPE) == POINTER_TYPE \ + : (POINTER_TYPE_P (VALTYPE) \ ? gen_rtx (REG, TYPE_MODE (VALTYPE), 8) \ : gen_rtx (REG, TYPE_MODE (VALTYPE), 0))) @@ -188,7 +209,7 @@ do { \ #undef BIGGEST_ALIGNMENT #define BIGGEST_ALIGNMENT 64 -/* SVR4 m68k assembler is bitching on the `comm i,1,1' which askes for +/* SVR4 m68k assembler is bitching on the `comm i,1,1' which asks for 1 byte alignment. Don't generate alignment for COMMON seems to be safer until we the assembler is fixed. */ #undef ASM_OUTPUT_ALIGNED_COMMON @@ -200,7 +221,7 @@ do { \ seems to be safer. */ #undef ASM_OUTPUT_ASCII #define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \ -{ \ +do { \ register int sp = 0, lp = 0, ch; \ fprintf ((FILE), "\t%s ", BYTE_ASM_OP); \ do { \ @@ -226,7 +247,7 @@ do { \ } \ } while (sp < (LEN)); \ putc ('\n', (FILE)); \ -} +} while (0) /* SVR4 m68k assembler is bitching on the syntax `2.b'. So use the "LLDnnn-LLnnn" format. Define LLDnnn after the table. */ @@ -263,8 +284,11 @@ int switch_table_difference_label_flag; operand of a function call. */ #undef LEGITIMATE_PIC_OPERAND_P #define LEGITIMATE_PIC_OPERAND_P(X) \ - (! symbolic_operand (X, VOIDmode) \ - || ((GET_CODE(X) == SYMBOL_REF) && SYMBOL_REF_FLAG(X))) + ((! symbolic_operand (X, VOIDmode) \ + && ! (GET_CODE (X) == CONST_DOUBLE && CONST_DOUBLE_MEM (X) \ + && GET_CODE (CONST_DOUBLE_MEM (X)) == MEM \ + && symbolic_operand (XEXP (CONST_DOUBLE_MEM (X), 0), VOIDmode))) \ + || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X))) /* Turn off function cse if we are doing PIC. We always want function call to be done as `bsr foo@PLTPC', so it will force the assembler to create