Commit 5811cb27 by Richard Sandiford Committed by Richard Sandiford

config.gcc (mips-*-*): Remove definitions of MASK_GAS and OBJECT_FORMAT_ELF.

	* config.gcc (mips-*-*): Remove definitions of MASK_GAS and
	OBJECT_FORMAT_ELF.  Set MASK_SPLIT_ADDR by default if using GNU ld.
	* config/mips/mips.h (MASK_GAS): Delete.  Shuffle later masks down.
	(TARGET_GAS, TARGET_MIPS_AS): Delete.
	(TARGET_GPWORD): Define to true for n32 on IRIX.
	(TARGET_SWITCHES): Remove -mmips-as.  Turn -mgas into a no-op.
	(MIPS_AS_ASM_SPEC, SUBTARGET_MIPS_AS_ASM_SPEC): Delete.
	(GAS_ASM_SPEC): Delete, folding into ASM_SPEC.
	(ASM_ABI_DEFAULT_SPEC, TARGET_ASM_SPEC): Delete.
	(MDEBUG_ASM_SPEC): Delete, folding into...
	(SUBTARGET_ASM_DEBUGGING_SPEC): ...here.
	(ASM_SPEC): Inline old GAS_ASM_SPEC.  Use GNU names for ABI switches.
	(EXTRA_SPECS): Remove mips_as_asm_spec, gas_asm_spec, target_asm_spec,
	subtarget_mips_as_asm_spec, mdebug_asm_spec.  Use MULTILIB_ABI_DEFAULT
	to define asm_abi_default_spec.
	(ASM_STABS_OP, ASM_STABN_OP, ASM_STABD_OP): Delete.
	(TARGET_ASM_SELECT_SECTION): Delete.
	* config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Define to 0x7ff0
	for non-mips16 code, removing previous workaround for SGI assemblers.
	(TARGET_ASM_INTEGER, mips_assemble_integer): Delete.
	(TARGET_ASM_ALIGNED_DI_OP): Define this instead.
	(override_options): Remove !TARGET_GAS and !have_named_sections code.
	(print_operand): Fold TARGET_GAS conditionals into asm strings.
	(mips_output_filename): Remove !TARGET_GAS code.  Replace use of
	ASM_STABS_OP and ASM_STABN_OP.
	(mips_file_start): Remove TARGET_MIPS_AS/TARGET_GAS checks.
	(mips_output_aligned_decl_common): Remove mention of SGI o32 assembler.
	(mips_output_function_prologue): Remove !TARGET_GAS code.
	(mips_select_rtx_section): Remove !have_named_sections code.
	(mips_select_section): Delete.
	* config/mips/mips.md (trap): Remove !TARGET_GAS check.
	* config/mips/linux.h (TARGET_DEFAULT): Remove use of MASK_GAS.
	* config/mips/sdb.h (PUT_SDB_DEF, PUT_SDB_PLAIN_DEF): Delete.
	(PUT_SDB_BLOCK_START, PUT_SDB_BLOCK_END): Fold TARGET_GAS conditional.
	* config/mips/vxworks.h (ASM_SPEC): As for mips.h.
	* config/mips/windiss.h (ASM_SPEC): Likewise.

testsuite/
	* gcc.dg/special/mips-abi.exp: Expect gcc to pass the GNU ABI flags
	to the assembler.  Simplify test accordingly.
	(asm_abi_flags): Use GNU names.
	(check_mips_abi, default_abi): Use string matches against "-mabi=*"
	to check for ABI flags.

From-SVN: r86405
parent 032e8348
2004-08-23 Richard Sandiford <rsandifo@redhat.com> 2004-08-23 Richard Sandiford <rsandifo@redhat.com>
* config.gcc (mips-*-*): Remove definitions of MASK_GAS and
OBJECT_FORMAT_ELF. Set MASK_SPLIT_ADDR by default if using GNU ld.
* config/mips/mips.h (MASK_GAS): Delete. Shuffle later masks down.
(TARGET_GAS, TARGET_MIPS_AS): Delete.
(TARGET_GPWORD): Define to true for n32 on IRIX.
(TARGET_SWITCHES): Remove -mmips-as. Turn -mgas into a no-op.
(MIPS_AS_ASM_SPEC, SUBTARGET_MIPS_AS_ASM_SPEC): Delete.
(GAS_ASM_SPEC): Delete, folding into ASM_SPEC.
(ASM_ABI_DEFAULT_SPEC, TARGET_ASM_SPEC): Delete.
(MDEBUG_ASM_SPEC): Delete, folding into...
(SUBTARGET_ASM_DEBUGGING_SPEC): ...here.
(ASM_SPEC): Inline old GAS_ASM_SPEC. Use GNU names for ABI switches.
(EXTRA_SPECS): Remove mips_as_asm_spec, gas_asm_spec, target_asm_spec,
subtarget_mips_as_asm_spec, mdebug_asm_spec. Use MULTILIB_ABI_DEFAULT
to define asm_abi_default_spec.
(ASM_STABS_OP, ASM_STABN_OP, ASM_STABD_OP): Delete.
(TARGET_ASM_SELECT_SECTION): Delete.
* config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Define to 0x7ff0
for non-mips16 code, removing previous workaround for SGI assemblers.
(TARGET_ASM_INTEGER, mips_assemble_integer): Delete.
(TARGET_ASM_ALIGNED_DI_OP): Define this instead.
(override_options): Remove !TARGET_GAS and !have_named_sections code.
(print_operand): Fold TARGET_GAS conditionals into asm strings.
(mips_output_filename): Remove !TARGET_GAS code. Replace use of
ASM_STABS_OP and ASM_STABN_OP.
(mips_file_start): Remove TARGET_MIPS_AS/TARGET_GAS checks.
(mips_output_aligned_decl_common): Remove mention of SGI o32 assembler.
(mips_output_function_prologue): Remove !TARGET_GAS code.
(mips_select_rtx_section): Remove !have_named_sections code.
(mips_select_section): Delete.
* config/mips/mips.md (trap): Remove !TARGET_GAS check.
* config/mips/linux.h (TARGET_DEFAULT): Remove use of MASK_GAS.
* config/mips/sdb.h (PUT_SDB_DEF, PUT_SDB_PLAIN_DEF): Delete.
(PUT_SDB_BLOCK_START, PUT_SDB_BLOCK_END): Fold TARGET_GAS conditional.
* config/mips/vxworks.h (ASM_SPEC): As for mips.h.
* config/mips/windiss.h (ASM_SPEC): Likewise.
2004-08-23 Richard Sandiford <rsandifo@redhat.com>
* read-rtl.c (map_value, mapping, macro_group): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures.
(BELLWETHER_CODE): New macro. (BELLWETHER_CODE): New macro.
(modes, codes, bellwether_codes): New variables. (modes, codes, bellwether_codes): New variables.
......
...@@ -1278,7 +1278,7 @@ mcore-*-pe*) ...@@ -1278,7 +1278,7 @@ mcore-*-pe*)
mips-sgi-irix[56]*) mips-sgi-irix[56]*)
tm_file="elfos.h ${tm_file} mips/iris.h" tm_file="elfos.h ${tm_file} mips/iris.h"
tmake_file="mips/t-iris mips/t-slibgcc-irix" tmake_file="mips/t-iris mips/t-slibgcc-irix"
target_cpu_default="MASK_GAS|MASK_ABICALLS" target_cpu_default="MASK_ABICALLS"
case ${target} in case ${target} in
*-*-irix5*) *-*-irix5*)
tm_file="${tm_file} mips/iris5.h" tm_file="${tm_file} mips/iris5.h"
...@@ -1304,7 +1304,7 @@ mips-sgi-irix[56]*) ...@@ -1304,7 +1304,7 @@ mips-sgi-irix[56]*)
use_fixproto=yes use_fixproto=yes
;; ;;
mips*-*-netbsd*) # NetBSD/mips, either endian. mips*-*-netbsd*) # NetBSD/mips, either endian.
target_cpu_default="MASK_GAS|MASK_ABICALLS" target_cpu_default="MASK_ABICALLS"
tm_file="elfos.h ${tm_file} mips/elf.h netbsd.h netbsd-elf.h mips/netbsd.h" tm_file="elfos.h ${tm_file} mips/elf.h netbsd.h netbsd-elf.h mips/netbsd.h"
;; ;;
mips64*-*-linux*) mips64*-*-linux*)
...@@ -1333,7 +1333,7 @@ mips*-*-linux*) # Linux MIPS, either endian. ...@@ -1333,7 +1333,7 @@ mips*-*-linux*) # Linux MIPS, either endian.
;; ;;
mips*-*-openbsd*) mips*-*-openbsd*)
tm_defines="OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_OBJECT OBSD_HAS_CORRECT_SPECS" tm_defines="OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_OBJECT OBSD_HAS_CORRECT_SPECS"
target_cpu_default="MASK_GAS|MASK_ABICALLS" target_cpu_default="MASK_ABICALLS"
tm_file="mips/mips.h openbsd.h mips/openbsd.h mips/sdb.h" tm_file="mips/mips.h openbsd.h mips/openbsd.h mips/sdb.h"
case ${target} in case ${target} in
mips*el-*-openbsd*) mips*el-*-openbsd*)
...@@ -1356,21 +1356,21 @@ mipsisa32r2-*-elf* | mipsisa32r2el-*-elf*) ...@@ -1356,21 +1356,21 @@ mipsisa32r2-*-elf* | mipsisa32r2el-*-elf*)
mipsisa64-*-elf* | mipsisa64el-*-elf*) mipsisa64-*-elf* | mipsisa64el-*-elf*)
tm_file="elfos.h ${tm_file} mips/elf.h" tm_file="elfos.h ${tm_file} mips/elf.h"
tmake_file=mips/t-isa3264 tmake_file=mips/t-isa3264
target_cpu_default="MASK_64BIT|MASK_FLOAT64|MASK_GAS" target_cpu_default="MASK_64BIT|MASK_FLOAT64"
tm_defines="MIPS_ISA_DEFAULT=64 MIPS_ABI_DEFAULT=ABI_EABI" tm_defines="MIPS_ISA_DEFAULT=64 MIPS_ABI_DEFAULT=ABI_EABI"
use_fixproto=yes use_fixproto=yes
;; ;;
mipsisa64sr71k-*-elf*) mipsisa64sr71k-*-elf*)
tm_file="elfos.h ${tm_file} mips/elf.h" tm_file="elfos.h ${tm_file} mips/elf.h"
tmake_file=mips/t-sr71k tmake_file=mips/t-sr71k
target_cpu_default="MASK_64BIT|MASK_FLOAT64|MASK_GAS" target_cpu_default="MASK_64BIT|MASK_FLOAT64"
tm_defines="MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sr71000\\\" MIPS_ABI_DEFAULT=ABI_EABI" tm_defines="MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sr71000\\\" MIPS_ABI_DEFAULT=ABI_EABI"
use_fixproto=yes use_fixproto=yes
;; ;;
mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*) mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
tm_file="elfos.h ${tm_file} mips/elf.h" tm_file="elfos.h ${tm_file} mips/elf.h"
tmake_file=mips/t-elf tmake_file=mips/t-elf
target_cpu_default="MASK_64BIT|MASK_FLOAT64|MASK_GAS" target_cpu_default="MASK_64BIT|MASK_FLOAT64"
tm_defines="MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sb1\\\" MIPS_ABI_DEFAULT=ABI_O64" tm_defines="MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sb1\\\" MIPS_ABI_DEFAULT=ABI_O64"
use_fixproto=yes use_fixproto=yes
;; ;;
...@@ -1382,7 +1382,7 @@ mips-*-elf* | mipsel-*-elf*) ...@@ -1382,7 +1382,7 @@ mips-*-elf* | mipsel-*-elf*)
mips64-*-elf* | mips64el-*-elf*) mips64-*-elf* | mips64el-*-elf*)
tm_file="elfos.h ${tm_file} mips/elf.h" tm_file="elfos.h ${tm_file} mips/elf.h"
tmake_file=mips/t-elf tmake_file=mips/t-elf
target_cpu_default="MASK_64BIT|MASK_FLOAT64|MASK_GAS" target_cpu_default="MASK_64BIT|MASK_FLOAT64"
tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64" tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
use_fixproto=yes use_fixproto=yes
;; ;;
...@@ -1394,7 +1394,7 @@ mips64vr-*-elf* | mips64vrel-*-elf*) ...@@ -1394,7 +1394,7 @@ mips64vr-*-elf* | mips64vrel-*-elf*)
mips64orion-*-elf* | mips64orionel-*-elf*) mips64orion-*-elf* | mips64orionel-*-elf*)
tm_file="elfos.h ${tm_file} mips/elforion.h mips/elf.h" tm_file="elfos.h ${tm_file} mips/elforion.h mips/elf.h"
tmake_file=mips/t-elf tmake_file=mips/t-elf
target_cpu_default="MASK_64BIT|MASK_FLOAT64|MASK_GAS" target_cpu_default="MASK_64BIT|MASK_FLOAT64"
tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64" tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
use_fixproto=yes use_fixproto=yes
;; ;;
...@@ -1407,13 +1407,11 @@ mips-wrs-vxworks) ...@@ -1407,13 +1407,11 @@ mips-wrs-vxworks)
# have to redo the tm_file list from scratch. # have to redo the tm_file list from scratch.
tm_file="elfos.h mips/mips.h svr4.h mips/elf.h vxworks.h mips/vxworks.h" tm_file="elfos.h mips/mips.h svr4.h mips/elf.h vxworks.h mips/vxworks.h"
tmake_file="${tmake_file} mips/t-vxworks" tmake_file="${tmake_file} mips/t-vxworks"
target_cpu_default="MASK_GAS"
;; ;;
mips-wrs-windiss) # Instruction-level simulator for VxWorks. mips-wrs-windiss) # Instruction-level simulator for VxWorks.
xm_defines=POSIX xm_defines=POSIX
tm_file="elfos.h mips/mips.h svr4.h mips/elf.h windiss.h mips/windiss.h" tm_file="elfos.h mips/mips.h svr4.h mips/elf.h windiss.h mips/windiss.h"
tmake_file="${tmake_file} mips/t-elf" tmake_file="${tmake_file} mips/t-elf"
target_cpu_default="MASK_GAS"
thread_file= thread_file=
;; ;;
mipstx39-*-elf* | mipstx39el-*-elf*) mipstx39-*-elf* | mipstx39el-*-elf*)
...@@ -2598,35 +2596,15 @@ fi ...@@ -2598,35 +2596,15 @@ fi
;; ;;
mips*-*-*) mips*-*-*)
case ${target} in if test x$gnu_ld = xyes
mips*-*-ecoff* | mips*-*-elf*) then
if test x$gas = xyes target_cpu_default2="MASK_SPLIT_ADDR"
then fi
if test x$gnu_ld = xyes
then
target_cpu_default2="MASK_GAS|MASK_SPLIT_ADDR"
else
target_cpu_default2="MASK_GAS"
fi
fi
;;
mips*-*-*)
if test x$gas = xyes
then
target_cpu_default2="MASK_GAS"
fi
;;
esac
case ${target} in case ${target} in
mips*el-*-*) mips*el-*-*)
tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines" tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines"
;; ;;
esac esac
case $tm_file in
*mips/elf.h*)
tm_defines="OBJECT_FORMAT_ELF $tm_defines"
;;
esac
if test "x$enable_gofast" = xyes if test "x$enable_gofast" = xyes
then then
tm_defines="US_SOFTWARE_GOFAST $tm_defines" tm_defines="US_SOFTWARE_GOFAST $tm_defines"
......
...@@ -51,7 +51,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -51,7 +51,7 @@ Boston, MA 02111-1307, USA. */
/* If we don't set MASK_ABICALLS, we can't default to PIC. */ /* If we don't set MASK_ABICALLS, we can't default to PIC. */
#undef TARGET_DEFAULT #undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_ABICALLS|MASK_GAS) #define TARGET_DEFAULT MASK_ABICALLS
#define TARGET_OS_CPP_BUILTINS() \ #define TARGET_OS_CPP_BUILTINS() \
do { \ do { \
......
...@@ -79,10 +79,8 @@ Boston, MA 02111-1307, USA. */ ...@@ -79,10 +79,8 @@ Boston, MA 02111-1307, USA. */
allocate and deallocate the top part of the frame. allocate and deallocate the top part of the frame.
The value in the !mips16 case must be a SMALL_OPERAND and must The value in the !mips16 case must be a SMALL_OPERAND and must
preserve the maximum stack alignment. It could really be 0x7ff0, preserve the maximum stack alignment. */
but SGI's assemblers implement daddiu $sp,$sp,-0x7ff0 as a #define MIPS_MAX_FIRST_STACK_STEP (TARGET_MIPS16 ? 0x100 : 0x7ff0)
multi-instruction addu sequence. Use 0x7fe0 to work around this. */
#define MIPS_MAX_FIRST_STACK_STEP (TARGET_MIPS16 ? 0x100 : 0x7fe0)
/* True if INSN is a mips.md pattern or asm statement. */ /* True if INSN is a mips.md pattern or asm statement. */
#define USEFUL_INSN_P(INSN) \ #define USEFUL_INSN_P(INSN) \
...@@ -180,7 +178,6 @@ static void mips_set_architecture (const struct mips_cpu_info *); ...@@ -180,7 +178,6 @@ static void mips_set_architecture (const struct mips_cpu_info *);
static void mips_set_tune (const struct mips_cpu_info *); static void mips_set_tune (const struct mips_cpu_info *);
static struct machine_function *mips_init_machine_status (void); static struct machine_function *mips_init_machine_status (void);
static void print_operand_reloc (FILE *, rtx, const char **); static void print_operand_reloc (FILE *, rtx, const char **);
static bool mips_assemble_integer (rtx, unsigned int, int);
#if TARGET_IRIX #if TARGET_IRIX
static void irix_output_external_libcall (rtx); static void irix_output_external_libcall (rtx);
#endif #endif
...@@ -208,8 +205,6 @@ static void mips_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, ...@@ -208,8 +205,6 @@ static void mips_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
static int symbolic_expression_p (rtx); static int symbolic_expression_p (rtx);
static void mips_select_rtx_section (enum machine_mode, rtx, static void mips_select_rtx_section (enum machine_mode, rtx,
unsigned HOST_WIDE_INT); unsigned HOST_WIDE_INT);
static void mips_select_section (tree, int, unsigned HOST_WIDE_INT)
ATTRIBUTE_UNUSED;
static bool mips_in_small_data_p (tree); static bool mips_in_small_data_p (tree);
static int mips_fpr_return_fields (tree, tree *); static int mips_fpr_return_fields (tree, tree *);
static bool mips_return_in_msb (tree); static bool mips_return_in_msb (tree);
...@@ -613,8 +608,8 @@ const struct mips_cpu_info mips_cpu_info_table[] = { ...@@ -613,8 +608,8 @@ const struct mips_cpu_info mips_cpu_info_table[] = {
#define TARGET_ASM_ALIGNED_HI_OP "\t.half\t" #define TARGET_ASM_ALIGNED_HI_OP "\t.half\t"
#undef TARGET_ASM_ALIGNED_SI_OP #undef TARGET_ASM_ALIGNED_SI_OP
#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t" #define TARGET_ASM_ALIGNED_SI_OP "\t.word\t"
#undef TARGET_ASM_INTEGER #undef TARGET_ASM_ALIGNED_DI_OP
#define TARGET_ASM_INTEGER mips_assemble_integer #define TARGET_ASM_ALIGNED_DI_OP "\t.dword\t"
#undef TARGET_ASM_FUNCTION_PROLOGUE #undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE mips_output_function_prologue #define TARGET_ASM_FUNCTION_PROLOGUE mips_output_function_prologue
...@@ -4063,20 +4058,6 @@ override_options (void) ...@@ -4063,20 +4058,6 @@ override_options (void)
warning ("-G is incompatible with PIC code which is the default"); warning ("-G is incompatible with PIC code which is the default");
} }
/* The MIPS and SGI o32 assemblers expect small-data variables to
be declared before they are used. Although we once had code to
do this, it was very invasive and fragile. It no longer seems
worth the effort. */
if (!TARGET_EXPLICIT_RELOCS && !TARGET_GAS)
mips_section_threshold = 0;
/* We switch to small data sections using ".section", which the native
o32 irix assemblers don't understand. Disable -G accordingly.
We must do this regardless of command-line options since otherwise
the compiler would abort. */
if (!targetm.have_named_sections)
mips_section_threshold = 0;
/* mips_split_addresses is a half-way house between explicit /* mips_split_addresses is a half-way house between explicit
relocations and the traditional assembler macros. It can relocations and the traditional assembler macros. It can
split absolute 32-bit symbolic constants into a high/lo_sum split absolute 32-bit symbolic constants into a high/lo_sum
...@@ -4087,20 +4068,13 @@ override_options (void) ...@@ -4087,20 +4068,13 @@ override_options (void)
Although this code should work for -O0, it has traditionally Although this code should work for -O0, it has traditionally
been treated as an optimization. */ been treated as an optimization. */
if (TARGET_GAS && !TARGET_MIPS16 && TARGET_SPLIT_ADDRESSES if (!TARGET_MIPS16 && TARGET_SPLIT_ADDRESSES
&& optimize && !flag_pic && optimize && !flag_pic
&& !ABI_HAS_64BIT_SYMBOLS) && !ABI_HAS_64BIT_SYMBOLS)
mips_split_addresses = 1; mips_split_addresses = 1;
else else
mips_split_addresses = 0; mips_split_addresses = 0;
/* Explicit relocations for "old" ABIs are a GNU extension. Unless
the user has said otherwise, assume that they are not available
with assemblers other than gas. */
if (!TARGET_NEWABI && !TARGET_GAS
&& (target_flags_explicit & MASK_EXPLICIT_RELOCS) == 0)
target_flags &= ~MASK_EXPLICIT_RELOCS;
/* -mvr4130-align is a "speed over size" optimization: it usually produces /* -mvr4130-align is a "speed over size" optimization: it usually produces
faster code, but at the expense of more nops. Enable it at -O3 and faster code, but at the expense of more nops. Enable it at -O3 and
above. */ above. */
...@@ -4646,14 +4620,14 @@ print_operand (FILE *file, rtx op, int letter) ...@@ -4646,14 +4620,14 @@ print_operand (FILE *file, rtx op, int letter)
case '{': case '{':
if (set_volatile++ == 0) if (set_volatile++ == 0)
fprintf (file, "%s.set\tvolatile\n\t", TARGET_MIPS_AS ? "" : "#"); fputs ("#.set\tvolatile\n\t", file);
break; break;
case '}': case '}':
if (set_volatile == 0) if (set_volatile == 0)
error ("internal error: %%} found without a %%{ in assembler pattern"); error ("internal error: %%} found without a %%{ in assembler pattern");
else if (--set_volatile == 0) else if (--set_volatile == 0)
fprintf (file, "\n\t%s.set\tnovolatile", (TARGET_MIPS_AS) ? "" : "#"); fputs ("\n\t#.set\tnovolatile", file);
break; break;
...@@ -4869,26 +4843,6 @@ print_operand_address (FILE *file, rtx x) ...@@ -4869,26 +4843,6 @@ print_operand_address (FILE *file, rtx x)
abort (); abort ();
} }
/* Target hook for assembling integer objects. It appears that the Irix
6 assembler can't handle 64-bit decimal integers, so avoid printing
such an integer here. */
static bool
mips_assemble_integer (rtx x, unsigned int size, int aligned_p)
{
if ((TARGET_64BIT || TARGET_GAS) && size == 8 && aligned_p)
{
fputs ("\t.dword\t", asm_out_file);
if (HOST_BITS_PER_WIDE_INT < 64 || GET_CODE (x) != CONST_INT)
output_addr_const (asm_out_file, x);
else
print_operand (asm_out_file, x, 'X');
fputc ('\n', asm_out_file);
return true;
}
return default_assemble_integer (x, size, aligned_p);
}
/* When using assembler macros, keep track of all of small-data externs /* When using assembler macros, keep track of all of small-data externs
so that mips_file_end can emit the appropriate declarations for them. so that mips_file_end can emit the appropriate declarations for them.
...@@ -4958,15 +4912,12 @@ mips_output_filename (FILE *stream, const char *name) ...@@ -4958,15 +4912,12 @@ mips_output_filename (FILE *stream, const char *name)
num_source_filenames += 1; num_source_filenames += 1;
current_function_file = name; current_function_file = name;
ASM_OUTPUT_FILENAME (stream, num_source_filenames, name); ASM_OUTPUT_FILENAME (stream, num_source_filenames, name);
/* This tells mips-tfile that stabs will follow. */
if (!TARGET_GAS && write_symbols == DBX_DEBUG)
fprintf (stream, "\t#@stabs\n");
} }
else if (write_symbols == DBX_DEBUG) else if (write_symbols == DBX_DEBUG)
{ {
ASM_GENERATE_INTERNAL_LABEL (ltext_label_name, "Ltext", 0); ASM_GENERATE_INTERNAL_LABEL (ltext_label_name, "Ltext", 0);
fprintf (stream, "%s", ASM_STABS_OP); fputs ("\t.stabs\t", stream);
output_quoted_string (stream, name); output_quoted_string (stream, name);
fprintf (stream, ",%d,0,0,%s\n", N_SOL, &ltext_label_name[1]); fprintf (stream, ",%d,0,0,%s\n", N_SOL, &ltext_label_name[1]);
} }
...@@ -4991,8 +4942,8 @@ mips_output_lineno (FILE *stream, int line) ...@@ -4991,8 +4942,8 @@ mips_output_lineno (FILE *stream, int line)
if (write_symbols == DBX_DEBUG) if (write_symbols == DBX_DEBUG)
{ {
++sym_lineno; ++sym_lineno;
fprintf (stream, "%sLM%d:\n%s%d,0,%d,%sLM%d\n", fprintf (stream, "%sLM%d:\n\t.stabn\t%d,0,%d,%sLM%d\n",
LOCAL_LABEL_PREFIX, sym_lineno, ASM_STABN_OP, N_SLINE, line, LOCAL_LABEL_PREFIX, sym_lineno, N_SLINE, line,
LOCAL_LABEL_PREFIX, sym_lineno); LOCAL_LABEL_PREFIX, sym_lineno);
} }
else else
...@@ -5087,15 +5038,7 @@ mips_file_start (void) ...@@ -5087,15 +5038,7 @@ mips_file_start (void)
{ {
default_file_start (); default_file_start ();
/* Versions of the MIPS assembler before 2.20 generate errors if a branch if (!TARGET_IRIX)
inside of a .set noreorder section jumps to a label outside of the .set
noreorder section. Revision 2.20 just set nobopt silently rather than
fixing the bug. */
if (TARGET_MIPS_AS && optimize && flag_delayed_branch)
fprintf (asm_out_file, "\t.set\tnobopt\n");
if (TARGET_GAS && !TARGET_IRIX)
{ {
/* Generate a special section to describe the ABI switches used to /* Generate a special section to describe the ABI switches used to
produce the resultant binary. This used to be done by the assembler produce the resultant binary. This used to be done by the assembler
...@@ -5212,9 +5155,8 @@ mips_file_end (void) ...@@ -5212,9 +5155,8 @@ mips_file_end (void)
} }
} }
/* Implement ASM_OUTPUT_ALIGNED_DECL_COMMON. This is usually the same as /* Implement ASM_OUTPUT_ALIGNED_DECL_COMMON. This is usually the same as the
the elfos.h version, but we also need to handle -muninit-const-in-rodata elfos.h version, but we also need to handle -muninit-const-in-rodata. */
and the limitations of the SGI o32 assembler. */
void void
mips_output_aligned_decl_common (FILE *stream, tree decl, const char *name, mips_output_aligned_decl_common (FILE *stream, tree decl, const char *name,
...@@ -5237,7 +5179,6 @@ mips_output_aligned_decl_common (FILE *stream, tree decl, const char *name, ...@@ -5237,7 +5179,6 @@ mips_output_aligned_decl_common (FILE *stream, tree decl, const char *name,
size); size);
} }
else else
/* The SGI o32 assembler doesn't accept an alignment. */
mips_declare_common_object (stream, name, "\n\t.comm\t", mips_declare_common_object (stream, name, "\n\t.comm\t",
size, align, true); size, align, true);
} }
...@@ -5862,12 +5803,6 @@ mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) ...@@ -5862,12 +5803,6 @@ mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
const char *fnname; const char *fnname;
HOST_WIDE_INT tsize = cfun->machine->frame.total_size; HOST_WIDE_INT tsize = cfun->machine->frame.total_size;
/* ??? When is this really needed? At least the GNU assembler does not
need the source filename more than once in the file, beyond what is
emitted by the debug information. */
if (!TARGET_GAS)
ASM_OUTPUT_SOURCE_FILENAME (file, DECL_SOURCE_FILE (current_function_decl));
#ifdef SDB_DEBUGGING_INFO #ifdef SDB_DEBUGGING_INFO
if (debug_info_level != DINFO_LEVEL_TERSE && write_symbols == SDB_DEBUG) if (debug_info_level != DINFO_LEVEL_TERSE && write_symbols == SDB_DEBUG)
ASM_OUTPUT_SOURCE_LINE (file, DECL_SOURCE_LINE (current_function_decl), 0); ASM_OUTPUT_SOURCE_LINE (file, DECL_SOURCE_LINE (current_function_decl), 0);
...@@ -6480,32 +6415,12 @@ mips_select_rtx_section (enum machine_mode mode, rtx x, ...@@ -6480,32 +6415,12 @@ mips_select_rtx_section (enum machine_mode mode, rtx x,
&& mips_section_threshold > 0) && mips_section_threshold > 0)
named_section (0, ".sdata", 0); named_section (0, ".sdata", 0);
else if (flag_pic && symbolic_expression_p (x)) else if (flag_pic && symbolic_expression_p (x))
{ named_section (0, ".data.rel.ro", 3);
if (targetm.have_named_sections)
named_section (0, ".data.rel.ro", 3);
else
data_section ();
}
else else
mergeable_constant_section (mode, align, 0); mergeable_constant_section (mode, align, 0);
} }
} }
/* Choose the section to use for DECL. RELOC is true if its value contains
any relocatable expression. */
static void
mips_select_section (tree decl, int reloc,
unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
{
if (targetm.have_named_sections)
default_elf_select_section (decl, reloc, align);
else
/* The native irix o32 assembler doesn't support named sections. */
default_select_section (decl, reloc, align);
}
/* Implement TARGET_IN_SMALL_DATA_P. Return true if it would be safe to /* Implement TARGET_IN_SMALL_DATA_P. Return true if it would be safe to
access DECL using %gp_rel(...)($gp). */ access DECL using %gp_rel(...)($gp). */
......
...@@ -133,34 +133,33 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -133,34 +133,33 @@ extern const struct mips_cpu_info *mips_tune_info;
#define MASK_SPLIT_ADDR 0x00000004 /* Address splitting is enabled. */ #define MASK_SPLIT_ADDR 0x00000004 /* Address splitting is enabled. */
#define MASK_NO_FUSED_MADD 0x00000008 /* Don't generate floating point #define MASK_NO_FUSED_MADD 0x00000008 /* Don't generate floating point
multiply-add operations. */ multiply-add operations. */
#define MASK_GAS 0x00000010 /* Gas used instead of MIPS as */ #define MASK_EXPLICIT_RELOCS 0x00000010 /* Use relocation operators. */
#define MASK_EXPLICIT_RELOCS 0x00000020 /* Use relocation operators. */ #define MASK_MEMCPY 0x00000020 /* call memcpy instead of inline code*/
#define MASK_MEMCPY 0x00000040 /* call memcpy instead of inline code*/ #define MASK_SOFT_FLOAT 0x00000040 /* software floating point */
#define MASK_SOFT_FLOAT 0x00000080 /* software floating point */ #define MASK_FLOAT64 0x00000080 /* fp registers are 64 bits */
#define MASK_FLOAT64 0x00000100 /* fp registers are 64 bits */ #define MASK_ABICALLS 0x00000100 /* emit .abicalls/.cprestore/.cpload */
#define MASK_ABICALLS 0x00000200 /* emit .abicalls/.cprestore/.cpload */ #define MASK_XGOT 0x00000200 /* emit big-got PIC */
#define MASK_XGOT 0x00000400 /* emit big-got PIC */ #define MASK_LONG_CALLS 0x00000400 /* Always call through a register */
#define MASK_LONG_CALLS 0x00000800 /* Always call through a register */ #define MASK_64BIT 0x00000800 /* Use 64 bit GP registers and insns */
#define MASK_64BIT 0x00001000 /* Use 64 bit GP registers and insns */ #define MASK_EMBEDDED_DATA 0x00001000 /* Reduce RAM usage, not fast code */
#define MASK_EMBEDDED_DATA 0x00002000 /* Reduce RAM usage, not fast code */ #define MASK_BIG_ENDIAN 0x00002000 /* Generate big endian code */
#define MASK_BIG_ENDIAN 0x00004000 /* Generate big endian code */ #define MASK_SINGLE_FLOAT 0x00004000 /* Only single precision FPU. */
#define MASK_SINGLE_FLOAT 0x00008000 /* Only single precision FPU. */ #define MASK_MAD 0x00008000 /* Generate mad/madu as on 4650. */
#define MASK_MAD 0x00010000 /* Generate mad/madu as on 4650. */ #define MASK_4300_MUL_FIX 0x00010000 /* Work-around early Vr4300 CPU bug */
#define MASK_4300_MUL_FIX 0x00020000 /* Work-around early Vr4300 CPU bug */ #define MASK_MIPS16 0x00020000 /* Generate mips16 code */
#define MASK_MIPS16 0x00040000 /* Generate mips16 code */
#define MASK_NO_CHECK_ZERO_DIV \ #define MASK_NO_CHECK_ZERO_DIV \
0x00080000 /* divide by zero checking */ 0x00040000 /* divide by zero checking */
#define MASK_BRANCHLIKELY 0x00100000 /* Generate Branch Likely #define MASK_BRANCHLIKELY 0x00080000 /* Generate Branch Likely
instructions. */ instructions. */
#define MASK_UNINIT_CONST_IN_RODATA \ #define MASK_UNINIT_CONST_IN_RODATA \
0x00200000 /* Store uninitialized 0x00100000 /* Store uninitialized
consts in rodata */ consts in rodata */
#define MASK_FIX_R4000 0x00400000 /* Work around R4000 errata. */ #define MASK_FIX_R4000 0x00200000 /* Work around R4000 errata. */
#define MASK_FIX_R4400 0x00800000 /* Work around R4400 errata. */ #define MASK_FIX_R4400 0x00400000 /* Work around R4400 errata. */
#define MASK_FIX_SB1 0x01000000 /* Work around SB-1 errata. */ #define MASK_FIX_SB1 0x00800000 /* Work around SB-1 errata. */
#define MASK_FIX_VR4120 0x02000000 /* Work around VR4120 errata. */ #define MASK_FIX_VR4120 0x01000000 /* Work around VR4120 errata. */
#define MASK_VR4130_ALIGN 0x04000000 /* Perform VR4130 alignment opts. */ #define MASK_VR4130_ALIGN 0x02000000 /* Perform VR4130 alignment opts. */
#define MASK_FP_EXCEPTIONS 0x08000000 /* FP exceptions are enabled. */ #define MASK_FP_EXCEPTIONS 0x04000000 /* FP exceptions are enabled. */
/* Debug switches, not documented */ /* Debug switches, not documented */
#define MASK_DEBUG 0 /* unused */ #define MASK_DEBUG 0 /* unused */
...@@ -178,10 +177,6 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -178,10 +177,6 @@ extern const struct mips_cpu_info *mips_tune_info;
/* Mips vs. GNU linker */ /* Mips vs. GNU linker */
#define TARGET_SPLIT_ADDRESSES ((target_flags & MASK_SPLIT_ADDR) != 0) #define TARGET_SPLIT_ADDRESSES ((target_flags & MASK_SPLIT_ADDR) != 0)
/* Mips vs. GNU assembler */
#define TARGET_GAS ((target_flags & MASK_GAS) != 0)
#define TARGET_MIPS_AS (!TARGET_GAS)
/* Debug Modes */ /* Debug Modes */
#define TARGET_DEBUG_MODE ((target_flags & MASK_DEBUG) != 0) #define TARGET_DEBUG_MODE ((target_flags & MASK_DEBUG) != 0)
#define TARGET_DEBUG_D_MODE ((target_flags & MASK_DEBUG_D) != 0) #define TARGET_DEBUG_D_MODE ((target_flags & MASK_DEBUG_D) != 0)
...@@ -271,22 +266,11 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -271,22 +266,11 @@ extern const struct mips_cpu_info *mips_tune_info;
(!TARGET_MIPS16 && (!TARGET_ABICALLS || TARGET_EXPLICIT_RELOCS)) (!TARGET_MIPS16 && (!TARGET_ABICALLS || TARGET_EXPLICIT_RELOCS))
/* True if .gpword or .gpdword should be used for switch tables. /* True if .gpword or .gpdword should be used for switch tables.
There are some problems with using these directives with the
native IRIX tools:
- It has been reported that some versions of the native n32
assembler mishandle .gpword, complaining that symbols are
global when they are in fact local.
- The native assemblers don't understand .gpdword.
- Although GAS does understand .gpdword, the native linker
mishandles the relocations GAS generates (R_MIPS_GPREL32
followed by R_MIPS_64).
We therefore disable GP-relative switch tables for n32 and n64 Although GAS does understand .gpdword, the SGI linker mishandles
on IRIX targets. */ the relocations GAS generates (R_MIPS_GPREL32 followed by R_MIPS_64).
#define TARGET_GPWORD (TARGET_ABICALLS && !(TARGET_NEWABI && TARGET_IRIX)) We therefore disable GP-relative switch tables for n64 on IRIX targets. */
#define TARGET_GPWORD (TARGET_ABICALLS && !(mips_abi == ABI_64 && TARGET_IRIX))
/* Generate mips16 code */ /* Generate mips16 code */
#define TARGET_MIPS16 ((target_flags & MASK_MIPS16) != 0) #define TARGET_MIPS16 ((target_flags & MASK_MIPS16) != 0)
...@@ -533,10 +517,8 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -533,10 +517,8 @@ extern const struct mips_cpu_info *mips_tune_info;
N_("Optimize lui/addiu address loads")}, \ N_("Optimize lui/addiu address loads")}, \
{"no-split-addresses", -MASK_SPLIT_ADDR, \ {"no-split-addresses", -MASK_SPLIT_ADDR, \
N_("Don't optimize lui/addiu address loads")}, \ N_("Don't optimize lui/addiu address loads")}, \
{"mips-as", -MASK_GAS, \ {"gas", 0, \
N_("Use MIPS as")}, \ N_("Use GNU as (now ignored)")}, \
{"gas", MASK_GAS, \
N_("Use GNU as")}, \
{"gpOPT", 0, \ {"gpOPT", 0, \
N_("Use GP relative sdata/sbss sections (now ignored)")}, \ N_("Use GP relative sdata/sbss sections (now ignored)")}, \
{"gpopt", 0, \ {"gpopt", 0, \
...@@ -1004,28 +986,6 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -1004,28 +986,6 @@ extern const struct mips_cpu_info *mips_tune_info;
#endif #endif
/* Assembler specs. */
/* MIPS_AS_ASM_SPEC is passed when using the MIPS assembler rather
than gas. */
#define MIPS_AS_ASM_SPEC "\
%{!.s:-nocpp} %{.s: %{cpp} %{nocpp}} \
%{pipe: %e-pipe is not supported} \
%{K} %(subtarget_mips_as_asm_spec)"
/* SUBTARGET_MIPS_AS_ASM_SPEC is passed when using the MIPS assembler
rather than gas. It may be overridden by subtargets. */
#ifndef SUBTARGET_MIPS_AS_ASM_SPEC
#define SUBTARGET_MIPS_AS_ASM_SPEC "%{v}"
#endif
/* GAS_ASM_SPEC is passed when using gas, rather than the MIPS
assembler. */
#define GAS_ASM_SPEC "%{mtune=*} %{v}"
#define SUBTARGET_TARGET_SWITCHES #define SUBTARGET_TARGET_SWITCHES
#ifndef MIPS_ABI_DEFAULT #ifndef MIPS_ABI_DEFAULT
...@@ -1036,48 +996,24 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -1036,48 +996,24 @@ extern const struct mips_cpu_info *mips_tune_info;
#if MIPS_ABI_DEFAULT == ABI_32 #if MIPS_ABI_DEFAULT == ABI_32
#define MULTILIB_ABI_DEFAULT "mabi=32" #define MULTILIB_ABI_DEFAULT "mabi=32"
#define ASM_ABI_DEFAULT_SPEC "-32"
#endif #endif
#if MIPS_ABI_DEFAULT == ABI_O64 #if MIPS_ABI_DEFAULT == ABI_O64
#define MULTILIB_ABI_DEFAULT "mabi=o64" #define MULTILIB_ABI_DEFAULT "mabi=o64"
#define ASM_ABI_DEFAULT_SPEC "-mabi=o64"
#endif #endif
#if MIPS_ABI_DEFAULT == ABI_N32 #if MIPS_ABI_DEFAULT == ABI_N32
#define MULTILIB_ABI_DEFAULT "mabi=n32" #define MULTILIB_ABI_DEFAULT "mabi=n32"
#define ASM_ABI_DEFAULT_SPEC "-n32"
#endif #endif
#if MIPS_ABI_DEFAULT == ABI_64 #if MIPS_ABI_DEFAULT == ABI_64
#define MULTILIB_ABI_DEFAULT "mabi=64" #define MULTILIB_ABI_DEFAULT "mabi=64"
#define ASM_ABI_DEFAULT_SPEC "-64"
#endif #endif
#if MIPS_ABI_DEFAULT == ABI_EABI #if MIPS_ABI_DEFAULT == ABI_EABI
#define MULTILIB_ABI_DEFAULT "mabi=eabi" #define MULTILIB_ABI_DEFAULT "mabi=eabi"
#define ASM_ABI_DEFAULT_SPEC "-mabi=eabi"
#endif #endif
/* TARGET_ASM_SPEC is used to select either MIPS_AS_ASM_SPEC or
GAS_ASM_SPEC as the default, depending upon the value of
TARGET_DEFAULT. */
#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GAS) != 0
/* GAS */
#define TARGET_ASM_SPEC "\
%{mmips-as: %(mips_as_asm_spec)} \
%{!mmips-as: %(gas_asm_spec)}"
#else /* not GAS */
#define TARGET_ASM_SPEC "\
%{!mgas: %(mips_as_asm_spec)} \
%{mgas: %(gas_asm_spec)}"
#endif /* not GAS */
/* SUBTARGET_ASM_OPTIMIZING_SPEC handles passing optimization options /* SUBTARGET_ASM_OPTIMIZING_SPEC handles passing optimization options
to the assembler. It may be overridden by subtargets. */ to the assembler. It may be overridden by subtargets. */
#ifndef SUBTARGET_ASM_OPTIMIZING_SPEC #ifndef SUBTARGET_ASM_OPTIMIZING_SPEC
...@@ -1087,7 +1023,11 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -1087,7 +1023,11 @@ extern const struct mips_cpu_info *mips_tune_info;
#endif #endif
/* SUBTARGET_ASM_DEBUGGING_SPEC handles passing debugging options to /* SUBTARGET_ASM_DEBUGGING_SPEC handles passing debugging options to
the assembler. It may be overridden by subtargets. */ the assembler. It may be overridden by subtargets.
Beginning with gas 2.13, -mdebug must be passed to correctly handle
COFF debugging info. */
#ifndef SUBTARGET_ASM_DEBUGGING_SPEC #ifndef SUBTARGET_ASM_DEBUGGING_SPEC
#define SUBTARGET_ASM_DEBUGGING_SPEC "\ #define SUBTARGET_ASM_DEBUGGING_SPEC "\
%{g} %{g0} %{g1} %{g2} %{g3} \ %{g} %{g0} %{g1} %{g2} %{g3} \
...@@ -1095,19 +1035,9 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -1095,19 +1035,9 @@ extern const struct mips_cpu_info *mips_tune_info;
%{gstabs:-g} %{gstabs0:-g0} %{gstabs1:-g1} %{gstabs2:-g2} %{gstabs3:-g3} \ %{gstabs:-g} %{gstabs0:-g0} %{gstabs1:-g1} %{gstabs2:-g2} %{gstabs3:-g3} \
%{gstabs+:-g} %{gstabs+0:-g0} %{gstabs+1:-g1} %{gstabs+2:-g2} %{gstabs+3:-g3} \ %{gstabs+:-g} %{gstabs+0:-g0} %{gstabs+1:-g1} %{gstabs+2:-g2} %{gstabs+3:-g3} \
%{gcoff:-g} %{gcoff0:-g0} %{gcoff1:-g1} %{gcoff2:-g2} %{gcoff3:-g3} \ %{gcoff:-g} %{gcoff0:-g0} %{gcoff1:-g1} %{gcoff2:-g2} %{gcoff3:-g3} \
%(mdebug_asm_spec)" %{gcoff*:-mdebug} %{!gcoff*:-no-mdebug}"
#endif #endif
/* Beginning with gas 2.13, -mdebug must be passed to correctly handle COFF
debugging info. */
#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GAS) != 0
/* GAS */
#define MDEBUG_ASM_SPEC "%{gcoff*:-mdebug} \
%{!gcoff*:-no-mdebug}"
#else /* not GAS */
#define MDEBUG_ASM_SPEC ""
#endif /* not GAS */
/* SUBTARGET_ASM_SPEC is always passed to the assembler. It may be /* SUBTARGET_ASM_SPEC is always passed to the assembler. It may be
overridden by subtargets. */ overridden by subtargets. */
...@@ -1115,12 +1045,6 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -1115,12 +1045,6 @@ extern const struct mips_cpu_info *mips_tune_info;
#define SUBTARGET_ASM_SPEC "" #define SUBTARGET_ASM_SPEC ""
#endif #endif
/* ASM_SPEC is the set of arguments to pass to the assembler. Note: we
pass -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64 regardless of
whether we're using GAS. These options can only be used properly
with GAS, and it is better to get an error from a non-GAS assembler
than to silently generate bad code. */
#undef ASM_SPEC #undef ASM_SPEC
#define ASM_SPEC "\ #define ASM_SPEC "\
%{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} \ %{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} \
...@@ -1129,10 +1053,9 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -1129,10 +1053,9 @@ extern const struct mips_cpu_info *mips_tune_info;
%{mfix-vr4120} \ %{mfix-vr4120} \
%(subtarget_asm_optimizing_spec) \ %(subtarget_asm_optimizing_spec) \
%(subtarget_asm_debugging_spec) \ %(subtarget_asm_debugging_spec) \
%{mabi=32:-32}%{mabi=n32:-n32}%{mabi=64:-64}%{mabi=n64:-64} \ %{mabi=*} %{!mabi*: %(asm_abi_default_spec)} \
%{mabi=eabi} %{mabi=o64} %{!mabi*: %(asm_abi_default_spec)} \
%{mgp32} %{mgp64} %{march=*} %{mxgot:-xgot} \ %{mgp32} %{mgp64} %{march=*} %{mxgot:-xgot} \
%(target_asm_spec) \ %{mtune=*} %{v} \
%(subtarget_asm_spec)" %(subtarget_asm_spec)"
/* Extra switches sometimes passed to the linker. */ /* Extra switches sometimes passed to the linker. */
...@@ -1188,15 +1111,10 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -1188,15 +1111,10 @@ extern const struct mips_cpu_info *mips_tune_info;
#define EXTRA_SPECS \ #define EXTRA_SPECS \
{ "subtarget_cc1_spec", SUBTARGET_CC1_SPEC }, \ { "subtarget_cc1_spec", SUBTARGET_CC1_SPEC }, \
{ "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }, \ { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }, \
{ "mips_as_asm_spec", MIPS_AS_ASM_SPEC }, \
{ "gas_asm_spec", GAS_ASM_SPEC }, \
{ "target_asm_spec", TARGET_ASM_SPEC }, \
{ "subtarget_mips_as_asm_spec", SUBTARGET_MIPS_AS_ASM_SPEC }, \
{ "subtarget_asm_optimizing_spec", SUBTARGET_ASM_OPTIMIZING_SPEC }, \ { "subtarget_asm_optimizing_spec", SUBTARGET_ASM_OPTIMIZING_SPEC }, \
{ "subtarget_asm_debugging_spec", SUBTARGET_ASM_DEBUGGING_SPEC }, \ { "subtarget_asm_debugging_spec", SUBTARGET_ASM_DEBUGGING_SPEC }, \
{ "mdebug_asm_spec", MDEBUG_ASM_SPEC }, \
{ "subtarget_asm_spec", SUBTARGET_ASM_SPEC }, \ { "subtarget_asm_spec", SUBTARGET_ASM_SPEC }, \
{ "asm_abi_default_spec", ASM_ABI_DEFAULT_SPEC }, \ { "asm_abi_default_spec", "-" MULTILIB_ABI_DEFAULT }, \
{ "endian_spec", ENDIAN_SPEC }, \ { "endian_spec", ENDIAN_SPEC }, \
SUBTARGET_EXTRA_SPECS SUBTARGET_EXTRA_SPECS
...@@ -1217,15 +1135,6 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -1217,15 +1135,6 @@ extern const struct mips_cpu_info *mips_tune_info;
/* By default, turn on GDB extensions. */ /* By default, turn on GDB extensions. */
#define DEFAULT_GDB_EXTENSIONS 1 #define DEFAULT_GDB_EXTENSIONS 1
/* If we are passing smuggling stabs through the MIPS ECOFF object
format, put a comment in front of the .stab<x> operation so
that the MIPS assembler does not choke. The mips-tfile program
will correctly put the stab into the object file. */
#define ASM_STABS_OP ((TARGET_GAS) ? "\t.stabs\t" : " #.stabs\t")
#define ASM_STABN_OP ((TARGET_GAS) ? "\t.stabn\t" : " #.stabn\t")
#define ASM_STABD_OP ((TARGET_GAS) ? "\t.stabd\t" : " #.stabd\t")
/* Local compiler-generated symbols must have a prefix that the assembler /* Local compiler-generated symbols must have a prefix that the assembler
understands. By default, this is $, although some targets (e.g., understands. By default, this is $, although some targets (e.g.,
NetBSD-ELF) need to override this. */ NetBSD-ELF) need to override this. */
...@@ -2997,12 +2906,6 @@ do { \ ...@@ -2997,12 +2906,6 @@ do { \
#undef READONLY_DATA_SECTION_ASM_OP #undef READONLY_DATA_SECTION_ASM_OP
#define READONLY_DATA_SECTION_ASM_OP "\t.rdata" /* read-only data */ #define READONLY_DATA_SECTION_ASM_OP "\t.rdata" /* read-only data */
/* Given a decl node or constant node, choose the section to output it in
and select that section. */
#undef TARGET_ASM_SELECT_SECTION
#define TARGET_ASM_SELECT_SECTION mips_select_section
#define ASM_OUTPUT_REG_PUSH(STREAM,REGNO) \ #define ASM_OUTPUT_REG_PUSH(STREAM,REGNO) \
do \ do \
......
...@@ -376,8 +376,7 @@ ...@@ -376,8 +376,7 @@
{ {
if (ISA_HAS_COND_TRAP) if (ISA_HAS_COND_TRAP)
return "teq\t$0,$0"; return "teq\t$0,$0";
/* The IRIX 6 O32 assembler requires the first break operand. */ else if (TARGET_MIPS16)
else if (TARGET_MIPS16 || !TARGET_GAS)
return "break 0"; return "break 0";
else else
return "break"; return "break";
......
...@@ -34,20 +34,6 @@ extern int sdb_label_count; ...@@ -34,20 +34,6 @@ extern int sdb_label_count;
/* Starting line of current function. */ /* Starting line of current function. */
extern int sdb_begin_function_line; extern int sdb_begin_function_line;
#define PUT_SDB_DEF(a) \
do { \
fprintf (asm_out_file, "\t%s.def\t", \
(TARGET_GAS) ? "" : "#"); \
ASM_OUTPUT_LABELREF (asm_out_file, a); \
fputc (';', asm_out_file); \
} while (0)
#define PUT_SDB_PLAIN_DEF(a) \
do { \
fprintf (asm_out_file, "\t%s.def\t.%s;", \
(TARGET_GAS) ? "" : "#", (a)); \
} while (0)
/* For block start and end, we create labels, so that /* For block start and end, we create labels, so that
later we can figure out where the correct offset is. later we can figure out where the correct offset is.
The normal .ent/.end serve well enough for functions, The normal .ent/.end serve well enough for functions,
...@@ -56,10 +42,9 @@ do { \ ...@@ -56,10 +42,9 @@ do { \
#define PUT_SDB_BLOCK_START(LINE) \ #define PUT_SDB_BLOCK_START(LINE) \
do { \ do { \
fprintf (asm_out_file, \ fprintf (asm_out_file, \
"%sLb%d:\n\t%s.begin\t%sLb%d\t%d\n", \ "%sLb%d:\n\t.begin\t%sLb%d\t%d\n", \
LOCAL_LABEL_PREFIX, \ LOCAL_LABEL_PREFIX, \
sdb_label_count, \ sdb_label_count, \
(TARGET_GAS) ? "" : "#", \
LOCAL_LABEL_PREFIX, \ LOCAL_LABEL_PREFIX, \
sdb_label_count, \ sdb_label_count, \
(LINE)); \ (LINE)); \
...@@ -69,10 +54,9 @@ do { \ ...@@ -69,10 +54,9 @@ do { \
#define PUT_SDB_BLOCK_END(LINE) \ #define PUT_SDB_BLOCK_END(LINE) \
do { \ do { \
fprintf (asm_out_file, \ fprintf (asm_out_file, \
"%sLe%d:\n\t%s.bend\t%sLe%d\t%d\n", \ "%sLe%d:\n\t.bend\t%sLe%d\t%d\n", \
LOCAL_LABEL_PREFIX, \ LOCAL_LABEL_PREFIX, \
sdb_label_count, \ sdb_label_count, \
(TARGET_GAS) ? "" : "#", \
LOCAL_LABEL_PREFIX, \ LOCAL_LABEL_PREFIX, \
sdb_label_count, \ sdb_label_count, \
(LINE)); \ (LINE)); \
......
...@@ -45,10 +45,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -45,10 +45,9 @@ Boston, MA 02111-1307, USA. */
%{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} \ %{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} \
%(subtarget_asm_optimizing_spec) \ %(subtarget_asm_optimizing_spec) \
%(subtarget_asm_debugging_spec) \ %(subtarget_asm_debugging_spec) \
%{mabi=32:-32}%{mabi=n32:-n32}%{mabi=64:-64}%{mabi=n64:-64} \ %{mabi=*} %{!mabi*: %(asm_abi_default_spec)} \
%{mabi=eabi} %{mabi=o64} %{!mabi*: %(asm_abi_default_spec)} \
%{mgp32} %{mgp64} %{march=*} %{mxgot:-xgot} \ %{mgp32} %{mgp64} %{march=*} %{mxgot:-xgot} \
%(target_asm_spec) \ %{mtune=*} %{v} \
%(subtarget_asm_spec)" %(subtarget_asm_spec)"
#undef LINK_SPEC #undef LINK_SPEC
......
...@@ -45,10 +45,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -45,10 +45,9 @@ Boston, MA 02111-1307, USA. */
%{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} \ %{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} \
%(subtarget_asm_optimizing_spec) \ %(subtarget_asm_optimizing_spec) \
%(subtarget_asm_debugging_spec) \ %(subtarget_asm_debugging_spec) \
%{mabi=32:-32}%{mabi=n32:-n32}%{mabi=64:-64}%{mabi=n64:-64} \ %{mabi=*} %{!mabi*: %(asm_abi_default_spec)} \
%{mabi=eabi} %{mabi=o64} %{!mabi*: %(asm_abi_default_spec)} \
%{mgp32} %{mgp64} %{march=*} %{mxgot:-xgot} \ %{mgp32} %{mgp64} %{march=*} %{mxgot:-xgot} \
%(target_asm_spec) \ %{mtune=*} %{v} \
%(subtarget_asm_spec)" %(subtarget_asm_spec)"
#undef LINK_SPEC #undef LINK_SPEC
......
2004-08-23 Richard Sandiford <rsandifo@redhat.com>
* gcc.dg/special/mips-abi.exp: Expect gcc to pass the GNU ABI flags
to the assembler. Simplify test accordingly.
(asm_abi_flags): Use GNU names.
(check_mips_abi, default_abi): Use string matches against "-mabi=*"
to check for ABI flags.
2004-08-22 Andrew Pinski <apinski@apple.com> 2004-08-22 Andrew Pinski <apinski@apple.com>
* g++.dg/opt/pr14029.C: New test. * g++.dg/opt/pr14029.C: New test.
......
# Copyright (C) 2002 Free Software Foundation, Inc. # Copyright (C) 2002, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -25,9 +25,8 @@ if {![istarget mips*-*-*] || [gcc_target_object_format] != "elf"} { ...@@ -25,9 +25,8 @@ if {![istarget mips*-*-*] || [gcc_target_object_format] != "elf"} {
return return
} }
# A list of all assembler ABI flags. We should use SGI-compatible # A list of all assembler ABI flags.
# flags where possible. set asm_abi_flags {-mabi=32 -mabi=n32 -mabi=64 -mabi=o64 -mabi=eabi}
set asm_abi_flags {-32 -n32 -64 -mabi=o64 -mabi=eabi}
# Try to assemble mips-abi.s (an empty file), passing -v in order to # Try to assemble mips-abi.s (an empty file), passing -v in order to
# get the assembler command line. Check whether an appropriate ABI # get the assembler command line. Check whether an appropriate ABI
...@@ -38,7 +37,7 @@ set asm_abi_flags {-32 -n32 -64 -mabi=o64 -mabi=eabi} ...@@ -38,7 +37,7 @@ set asm_abi_flags {-32 -n32 -64 -mabi=o64 -mabi=eabi}
# ABI flag is expected. # ABI flag is expected.
# FLAGS is a list of options for gcc. # FLAGS is a list of options for gcc.
proc check_mips_abi {name abis flags} { proc check_mips_abi {name abis flags} {
global srcdir subdir asm_abi_flags global srcdir subdir
lappend flags "-v" lappend flags "-v"
set lines [gcc_target_compile "$srcdir/$subdir/mips-abi.s" \ set lines [gcc_target_compile "$srcdir/$subdir/mips-abi.s" \
...@@ -54,7 +53,7 @@ proc check_mips_abi {name abis flags} { ...@@ -54,7 +53,7 @@ proc check_mips_abi {name abis flags} {
# ABI options. # ABI options.
if {[lsearch -exact $abis $arg] >= 0} { if {[lsearch -exact $abis $arg] >= 0} {
incr good incr good
} elseif {[lsearch -exact $asm_abi_flags $arg] >= 0} { } elseif {[string match "-mabi=*" $arg]} {
incr bad incr bad
} }
} }
...@@ -83,29 +82,23 @@ if {[board_info $target exists multilib_flags]} { ...@@ -83,29 +82,23 @@ if {[board_info $target exists multilib_flags]} {
# See whether the default command line specifies an ABI. # See whether the default command line specifies an ABI.
set default_abi "" set default_abi ""
foreach flag $default_flags { foreach flag $default_flags {
if {[string first "-mabi" $flag] == 0} { if {[string match "-mabi=*" $flag]} {
set default_abi $flag set default_abi $flag
} }
} }
# If the command line does specify an ABI, just check for the # If the command line does specify an ABI, just check for the
# appropriate assembler flag. # appropriate assembler flag.
switch -- $default_abi { if {$default_abi != ""} {
-mabi=eabi { check_mips_abi "EABI" "-mabi=eabi" "" } check_mips_abi "command line" $default_abi ""
-mabi=32 { check_mips_abi "o32" "-32" "" } } else {
-mabi=n32 { check_mips_abi "n32" "-n32" "" } # An ABI should be passed to the assembler by default.
-mabi=o64 { check_mips_abi "o64" "-mabi=o64" "" } # It doesn't seem worthwhile to duplicate the
-mabi=64 { check_mips_abi "n64" "-64" "" } # configuration to ABI logic here, so just accept any ABI.
"" { check_mips_abi "default" $asm_abi_flags ""
# An ABI should be passed to the assembler by default.
# It doesn't seem worthwhile to duplicate the
# configuration to ABI logic here, so just accept any ABI.
check_mips_abi "default" $asm_abi_flags ""
# See whether passing a -mabi flag does the right thing. # See whether passing a -mabi flag does the right thing.
# Only try ABIs that the SGI assembler also understands. foreach abi $asm_abi_flags {
check_mips_abi "o32" "-32" "-mabi=32" check_mips_abi $abi $abi $abi
check_mips_abi "n32" "-n32" "-mabi=n32"
check_mips_abi "64" "-64" "-mabi=64"
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment