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>
* 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.
(BELLWETHER_CODE): New macro.
(modes, codes, bellwether_codes): New variables.
......
......@@ -1278,7 +1278,7 @@ mcore-*-pe*)
mips-sgi-irix[56]*)
tm_file="elfos.h ${tm_file} mips/iris.h"
tmake_file="mips/t-iris mips/t-slibgcc-irix"
target_cpu_default="MASK_GAS|MASK_ABICALLS"
target_cpu_default="MASK_ABICALLS"
case ${target} in
*-*-irix5*)
tm_file="${tm_file} mips/iris5.h"
......@@ -1304,7 +1304,7 @@ mips-sgi-irix[56]*)
use_fixproto=yes
;;
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"
;;
mips64*-*-linux*)
......@@ -1333,7 +1333,7 @@ mips*-*-linux*) # Linux MIPS, either endian.
;;
mips*-*-openbsd*)
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"
case ${target} in
mips*el-*-openbsd*)
......@@ -1356,21 +1356,21 @@ mipsisa32r2-*-elf* | mipsisa32r2el-*-elf*)
mipsisa64-*-elf* | mipsisa64el-*-elf*)
tm_file="elfos.h ${tm_file} mips/elf.h"
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"
use_fixproto=yes
;;
mipsisa64sr71k-*-elf*)
tm_file="elfos.h ${tm_file} mips/elf.h"
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"
use_fixproto=yes
;;
mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
tm_file="elfos.h ${tm_file} mips/elf.h"
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"
use_fixproto=yes
;;
......@@ -1382,7 +1382,7 @@ mips-*-elf* | mipsel-*-elf*)
mips64-*-elf* | mips64el-*-elf*)
tm_file="elfos.h ${tm_file} mips/elf.h"
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"
use_fixproto=yes
;;
......@@ -1394,7 +1394,7 @@ mips64vr-*-elf* | mips64vrel-*-elf*)
mips64orion-*-elf* | mips64orionel-*-elf*)
tm_file="elfos.h ${tm_file} mips/elforion.h mips/elf.h"
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"
use_fixproto=yes
;;
......@@ -1407,13 +1407,11 @@ mips-wrs-vxworks)
# 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"
tmake_file="${tmake_file} mips/t-vxworks"
target_cpu_default="MASK_GAS"
;;
mips-wrs-windiss) # Instruction-level simulator for VxWorks.
xm_defines=POSIX
tm_file="elfos.h mips/mips.h svr4.h mips/elf.h windiss.h mips/windiss.h"
tmake_file="${tmake_file} mips/t-elf"
target_cpu_default="MASK_GAS"
thread_file=
;;
mipstx39-*-elf* | mipstx39el-*-elf*)
......@@ -2598,35 +2596,15 @@ fi
;;
mips*-*-*)
case ${target} in
mips*-*-ecoff* | mips*-*-elf*)
if test x$gas = xyes
then
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
if test x$gnu_ld = xyes
then
target_cpu_default2="MASK_SPLIT_ADDR"
fi
case ${target} in
mips*el-*-*)
tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines"
;;
esac
case $tm_file in
*mips/elf.h*)
tm_defines="OBJECT_FORMAT_ELF $tm_defines"
;;
esac
if test "x$enable_gofast" = xyes
then
tm_defines="US_SOFTWARE_GOFAST $tm_defines"
......
......@@ -51,7 +51,7 @@ Boston, MA 02111-1307, USA. */
/* If we don't set MASK_ABICALLS, we can't default to PIC. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_ABICALLS|MASK_GAS)
#define TARGET_DEFAULT MASK_ABICALLS
#define TARGET_OS_CPP_BUILTINS() \
do { \
......
......@@ -79,10 +79,8 @@ Boston, MA 02111-1307, USA. */
allocate and deallocate the top part of the frame.
The value in the !mips16 case must be a SMALL_OPERAND and must
preserve the maximum stack alignment. It could really be 0x7ff0,
but SGI's assemblers implement daddiu $sp,$sp,-0x7ff0 as a
multi-instruction addu sequence. Use 0x7fe0 to work around this. */
#define MIPS_MAX_FIRST_STACK_STEP (TARGET_MIPS16 ? 0x100 : 0x7fe0)
preserve the maximum stack alignment. */
#define MIPS_MAX_FIRST_STACK_STEP (TARGET_MIPS16 ? 0x100 : 0x7ff0)
/* True if INSN is a mips.md pattern or asm statement. */
#define USEFUL_INSN_P(INSN) \
......@@ -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 struct machine_function *mips_init_machine_status (void);
static void print_operand_reloc (FILE *, rtx, const char **);
static bool mips_assemble_integer (rtx, unsigned int, int);
#if TARGET_IRIX
static void irix_output_external_libcall (rtx);
#endif
......@@ -208,8 +205,6 @@ static void mips_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
static int symbolic_expression_p (rtx);
static void mips_select_rtx_section (enum machine_mode, rtx,
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 int mips_fpr_return_fields (tree, tree *);
static bool mips_return_in_msb (tree);
......@@ -613,8 +608,8 @@ const struct mips_cpu_info mips_cpu_info_table[] = {
#define TARGET_ASM_ALIGNED_HI_OP "\t.half\t"
#undef TARGET_ASM_ALIGNED_SI_OP
#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t"
#undef TARGET_ASM_INTEGER
#define TARGET_ASM_INTEGER mips_assemble_integer
#undef TARGET_ASM_ALIGNED_DI_OP
#define TARGET_ASM_ALIGNED_DI_OP "\t.dword\t"
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE mips_output_function_prologue
......@@ -4063,20 +4058,6 @@ override_options (void)
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
relocations and the traditional assembler macros. It can
split absolute 32-bit symbolic constants into a high/lo_sum
......@@ -4087,20 +4068,13 @@ override_options (void)
Although this code should work for -O0, it has traditionally
been treated as an optimization. */
if (TARGET_GAS && !TARGET_MIPS16 && TARGET_SPLIT_ADDRESSES
if (!TARGET_MIPS16 && TARGET_SPLIT_ADDRESSES
&& optimize && !flag_pic
&& !ABI_HAS_64BIT_SYMBOLS)
mips_split_addresses = 1;
else
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
faster code, but at the expense of more nops. Enable it at -O3 and
above. */
......@@ -4646,14 +4620,14 @@ print_operand (FILE *file, rtx op, int letter)
case '{':
if (set_volatile++ == 0)
fprintf (file, "%s.set\tvolatile\n\t", TARGET_MIPS_AS ? "" : "#");
fputs ("#.set\tvolatile\n\t", file);
break;
case '}':
if (set_volatile == 0)
error ("internal error: %%} found without a %%{ in assembler pattern");
else if (--set_volatile == 0)
fprintf (file, "\n\t%s.set\tnovolatile", (TARGET_MIPS_AS) ? "" : "#");
fputs ("\n\t#.set\tnovolatile", file);
break;
......@@ -4869,26 +4843,6 @@ print_operand_address (FILE *file, rtx x)
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
so that mips_file_end can emit the appropriate declarations for them.
......@@ -4958,15 +4912,12 @@ mips_output_filename (FILE *stream, const char *name)
num_source_filenames += 1;
current_function_file = 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)
{
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);
fprintf (stream, ",%d,0,0,%s\n", N_SOL, &ltext_label_name[1]);
}
......@@ -4991,8 +4942,8 @@ mips_output_lineno (FILE *stream, int line)
if (write_symbols == DBX_DEBUG)
{
++sym_lineno;
fprintf (stream, "%sLM%d:\n%s%d,0,%d,%sLM%d\n",
LOCAL_LABEL_PREFIX, sym_lineno, ASM_STABN_OP, N_SLINE, line,
fprintf (stream, "%sLM%d:\n\t.stabn\t%d,0,%d,%sLM%d\n",
LOCAL_LABEL_PREFIX, sym_lineno, N_SLINE, line,
LOCAL_LABEL_PREFIX, sym_lineno);
}
else
......@@ -5087,15 +5038,7 @@ mips_file_start (void)
{
default_file_start ();
/* Versions of the MIPS assembler before 2.20 generate errors if a branch
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)
if (!TARGET_IRIX)
{
/* Generate a special section to describe the ABI switches used to
produce the resultant binary. This used to be done by the assembler
......@@ -5212,9 +5155,8 @@ mips_file_end (void)
}
}
/* Implement ASM_OUTPUT_ALIGNED_DECL_COMMON. This is usually the same as
the elfos.h version, but we also need to handle -muninit-const-in-rodata
and the limitations of the SGI o32 assembler. */
/* Implement ASM_OUTPUT_ALIGNED_DECL_COMMON. This is usually the same as the
elfos.h version, but we also need to handle -muninit-const-in-rodata. */
void
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);
}
else
/* The SGI o32 assembler doesn't accept an alignment. */
mips_declare_common_object (stream, name, "\n\t.comm\t",
size, align, true);
}
......@@ -5862,12 +5803,6 @@ mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
const char *fnname;
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
if (debug_info_level != DINFO_LEVEL_TERSE && write_symbols == SDB_DEBUG)
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,
&& mips_section_threshold > 0)
named_section (0, ".sdata", 0);
else if (flag_pic && symbolic_expression_p (x))
{
if (targetm.have_named_sections)
named_section (0, ".data.rel.ro", 3);
else
data_section ();
}
named_section (0, ".data.rel.ro", 3);
else
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
access DECL using %gp_rel(...)($gp). */
......
......@@ -376,8 +376,7 @@
{
if (ISA_HAS_COND_TRAP)
return "teq\t$0,$0";
/* The IRIX 6 O32 assembler requires the first break operand. */
else if (TARGET_MIPS16 || !TARGET_GAS)
else if (TARGET_MIPS16)
return "break 0";
else
return "break";
......
......@@ -34,20 +34,6 @@ extern int sdb_label_count;
/* Starting line of current function. */
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
later we can figure out where the correct offset is.
The normal .ent/.end serve well enough for functions,
......@@ -56,10 +42,9 @@ do { \
#define PUT_SDB_BLOCK_START(LINE) \
do { \
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, \
sdb_label_count, \
(TARGET_GAS) ? "" : "#", \
LOCAL_LABEL_PREFIX, \
sdb_label_count, \
(LINE)); \
......@@ -69,10 +54,9 @@ do { \
#define PUT_SDB_BLOCK_END(LINE) \
do { \
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, \
sdb_label_count, \
(TARGET_GAS) ? "" : "#", \
LOCAL_LABEL_PREFIX, \
sdb_label_count, \
(LINE)); \
......
......@@ -45,10 +45,9 @@ Boston, MA 02111-1307, USA. */
%{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} \
%(subtarget_asm_optimizing_spec) \
%(subtarget_asm_debugging_spec) \
%{mabi=32:-32}%{mabi=n32:-n32}%{mabi=64:-64}%{mabi=n64:-64} \
%{mabi=eabi} %{mabi=o64} %{!mabi*: %(asm_abi_default_spec)} \
%{mabi=*} %{!mabi*: %(asm_abi_default_spec)} \
%{mgp32} %{mgp64} %{march=*} %{mxgot:-xgot} \
%(target_asm_spec) \
%{mtune=*} %{v} \
%(subtarget_asm_spec)"
#undef LINK_SPEC
......
......@@ -45,10 +45,9 @@ Boston, MA 02111-1307, USA. */
%{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} \
%(subtarget_asm_optimizing_spec) \
%(subtarget_asm_debugging_spec) \
%{mabi=32:-32}%{mabi=n32:-n32}%{mabi=64:-64}%{mabi=n64:-64} \
%{mabi=eabi} %{mabi=o64} %{!mabi*: %(asm_abi_default_spec)} \
%{mabi=*} %{!mabi*: %(asm_abi_default_spec)} \
%{mgp32} %{mgp64} %{march=*} %{mxgot:-xgot} \
%(target_asm_spec) \
%{mtune=*} %{v} \
%(subtarget_asm_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>
* 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
# 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"} {
return
}
# A list of all assembler ABI flags. We should use SGI-compatible
# flags where possible.
set asm_abi_flags {-32 -n32 -64 -mabi=o64 -mabi=eabi}
# A list of all assembler ABI flags.
set asm_abi_flags {-mabi=32 -mabi=n32 -mabi=64 -mabi=o64 -mabi=eabi}
# Try to assemble mips-abi.s (an empty file), passing -v in order to
# 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}
# ABI flag is expected.
# FLAGS is a list of options for gcc.
proc check_mips_abi {name abis flags} {
global srcdir subdir asm_abi_flags
global srcdir subdir
lappend flags "-v"
set lines [gcc_target_compile "$srcdir/$subdir/mips-abi.s" \
......@@ -54,7 +53,7 @@ proc check_mips_abi {name abis flags} {
# ABI options.
if {[lsearch -exact $abis $arg] >= 0} {
incr good
} elseif {[lsearch -exact $asm_abi_flags $arg] >= 0} {
} elseif {[string match "-mabi=*" $arg]} {
incr bad
}
}
......@@ -83,29 +82,23 @@ if {[board_info $target exists multilib_flags]} {
# See whether the default command line specifies an ABI.
set default_abi ""
foreach flag $default_flags {
if {[string first "-mabi" $flag] == 0} {
if {[string match "-mabi=*" $flag]} {
set default_abi $flag
}
}
# If the command line does specify an ABI, just check for the
# appropriate assembler flag.
switch -- $default_abi {
-mabi=eabi { check_mips_abi "EABI" "-mabi=eabi" "" }
-mabi=32 { check_mips_abi "o32" "-32" "" }
-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.
# 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 ""
if {$default_abi != ""} {
check_mips_abi "command line" $default_abi ""
} else {
# 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.
# Only try ABIs that the SGI assembler also understands.
check_mips_abi "o32" "-32" "-mabi=32"
check_mips_abi "n32" "-n32" "-mabi=n32"
check_mips_abi "64" "-64" "-mabi=64"
# See whether passing a -mabi flag does the right thing.
foreach abi $asm_abi_flags {
check_mips_abi $abi $abi $abi
}
}
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