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
mips*-*-ecoff* | mips*-*-elf*)
if test x$gas = xyes
then
if test x$gnu_ld = xyes if test x$gnu_ld = xyes
then then
target_cpu_default2="MASK_GAS|MASK_SPLIT_ADDR" target_cpu_default2="MASK_SPLIT_ADDR"
else
target_cpu_default2="MASK_GAS"
fi
fi
;;
mips*-*-*)
if test x$gas = xyes
then
target_cpu_default2="MASK_GAS"
fi 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))
{
if (targetm.have_named_sections)
named_section (0, ".data.rel.ro", 3); named_section (0, ".data.rel.ro", 3);
else else
data_section ();
}
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). */
......
...@@ -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" "" }
-mabi=o64 { check_mips_abi "o64" "-mabi=o64" "" }
-mabi=64 { check_mips_abi "n64" "-64" "" }
"" {
# An ABI should be passed to the assembler by default. # An ABI should be passed to the assembler by default.
# It doesn't seem worthwhile to duplicate the # It doesn't seem worthwhile to duplicate the
# configuration to ABI logic here, so just accept any ABI. # configuration to ABI logic here, so just accept any ABI.
check_mips_abi "default" $asm_abi_flags "" 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