Commit e8b84d3d by Richard Sandiford Committed by Richard Sandiford

mips-protos.h (mips_simplify_dwarf_addr): Remove.

	* config/mips/mips-protos.h (mips_simplify_dwarf_addr): Remove.
	(mips_delegitimize_address): Declare.
	* config/mips/mips.h (ASM_SIMPLIFY_DWARF_ADDR): Undefine.
	(FIND_BASE_TERM): Define.
	* config/mips/mips.c (TARGET_DELEGITIMIZE_ADDRESS): Define.
	(mips_delegitimize_address): Renamed from mips_simplify_dwarf_addr.
	Handle small-data addresses.

From-SVN: r66518
parent 92d568f2
2003-05-06 Richard Sandiford <rsandifo@redhat.com>
* config/mips/mips-protos.h (mips_simplify_dwarf_addr): Remove.
(mips_delegitimize_address): Declare.
* config/mips/mips.h (ASM_SIMPLIFY_DWARF_ADDR): Undefine.
(FIND_BASE_TERM): Define.
* config/mips/mips.c (TARGET_DELEGITIMIZE_ADDRESS): Define.
(mips_delegitimize_address): Renamed from mips_simplify_dwarf_addr.
Handle small-data addresses.
2003-05-05 Roger Sayle <roger@eyesopen.com> 2003-05-05 Roger Sayle <roger@eyesopen.com>
* real.c (real_powi): New function to calculate the value of * real.c (real_powi): New function to calculate the value of
......
...@@ -141,7 +141,7 @@ extern bool mips_legitimize_address PARAMS ((rtx *, ...@@ -141,7 +141,7 @@ extern bool mips_legitimize_address PARAMS ((rtx *,
enum machine_mode)); enum machine_mode));
extern bool mips_legitimize_move PARAMS ((enum machine_mode, extern bool mips_legitimize_move PARAMS ((enum machine_mode,
rtx, rtx)); rtx, rtx));
extern rtx mips_simplify_dwarf_addr PARAMS ((rtx)); extern rtx mips_delegitimize_address PARAMS ((rtx));
extern void mips_expand_call PARAMS ((rtx, rtx, rtx, rtx, int)); extern void mips_expand_call PARAMS ((rtx, rtx, rtx, rtx, int));
extern int mips_reg_mode_ok_for_base_p PARAMS ((rtx, extern int mips_reg_mode_ok_for_base_p PARAMS ((rtx,
enum machine_mode, enum machine_mode,
......
...@@ -881,6 +881,8 @@ const struct mips_cpu_info mips_cpu_info_table[] = { ...@@ -881,6 +881,8 @@ const struct mips_cpu_info mips_cpu_info_table[] = {
#define TARGET_RTX_COSTS mips_rtx_costs #define TARGET_RTX_COSTS mips_rtx_costs
#undef TARGET_ADDRESS_COST #undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST mips_address_cost #define TARGET_ADDRESS_COST mips_address_cost
#undef TARGET_DELEGITIMIZE_ADDRESS
#define TARGET_DELEGITIMIZE_ADDRESS mips_delegitimize_address
#undef TARGET_ENCODE_SECTION_INFO #undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO mips_encode_section_info #define TARGET_ENCODE_SECTION_INFO mips_encode_section_info
...@@ -2193,23 +2195,11 @@ mips_legitimize_move (mode, dest, src) ...@@ -2193,23 +2195,11 @@ mips_legitimize_move (mode, dest, src)
} }
/* Simplify an address for dwarf debugging info. The main purpose of /* Convert GOT and GP-relative accesses back into their original form.
this function is to convert GOT references back into symbolic form. Used by bothh TARGET_DELEGITIMIZE_ADDRESS and FIND_BASE_TERM. */
For example, suppose a pseudo register R is found to be equivalent
to a GOT reference. This reference would be stored in reg_equiv_mem[R].
The dwarf code may try to use this reference as the location of the
variable associated with R. Normally, an address like:
(plus $gp (unspec [FOO] RELOC))
would be converted into individual components, but we can't emit
(unspec [FOO] RELOC) in .word directives. We avoid this problem
(and generate better debug information) by converting the reference
back into its original form. */
rtx rtx
mips_simplify_dwarf_addr (x) mips_delegitimize_address (x)
rtx x; rtx x;
{ {
struct mips_constant_info c; struct mips_constant_info c;
...@@ -2219,6 +2209,14 @@ mips_simplify_dwarf_addr (x) ...@@ -2219,6 +2209,14 @@ mips_simplify_dwarf_addr (x)
&& mips_classify_constant (&c, XEXP (XEXP (x, 0), 1)) == CONSTANT_RELOC && mips_classify_constant (&c, XEXP (XEXP (x, 0), 1)) == CONSTANT_RELOC
&& mips_classify_symbol (XVECEXP (c.symbol, 0, 0)) == SYMBOL_GOT_GLOBAL) && mips_classify_symbol (XVECEXP (c.symbol, 0, 0)) == SYMBOL_GOT_GLOBAL)
return XVECEXP (c.symbol, 0, 0); return XVECEXP (c.symbol, 0, 0);
if (GET_CODE (x) == PLUS
&& (XEXP (x, 0) == pic_offset_table_rtx
|| XEXP (x, 0) == cfun->machine->mips16_gp_pseudo_rtx)
&& mips_classify_constant (&c, XEXP (x, 1)) == CONSTANT_RELOC
&& mips_classify_symbol (XVECEXP (c.symbol, 0, 0)) == SYMBOL_SMALL_DATA)
return plus_constant (XVECEXP (c.symbol, 0, 0), c.offset);
return x; return x;
} }
......
...@@ -1348,7 +1348,7 @@ extern int mips_abi; ...@@ -1348,7 +1348,7 @@ extern int mips_abi;
SFmode register saves. */ SFmode register saves. */
#define DWARF_CIE_DATA_ALIGNMENT 4 #define DWARF_CIE_DATA_ALIGNMENT 4
#define ASM_SIMPLIFY_DWARF_ADDR mips_simplify_dwarf_addr #define FIND_BASE_TERM(X) mips_delegitimize_address (X)
/* Overrides for the COFF debug format. */ /* Overrides for the COFF debug format. */
#define PUT_SDB_SCL(a) \ #define PUT_SDB_SCL(a) \
......
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