summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/mips/mips-protos.h2
-rw-r--r--gcc/config/mips/mips.c28
-rw-r--r--gcc/config/mips/mips.h2
4 files changed, 25 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ae2db06226c..6af29241e29 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+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>
* real.c (real_powi): New function to calculate the value of
diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h
index eb6b5e61a00..140e60b0196 100644
--- a/gcc/config/mips/mips-protos.h
+++ b/gcc/config/mips/mips-protos.h
@@ -141,7 +141,7 @@ extern bool mips_legitimize_address PARAMS ((rtx *,
enum machine_mode));
extern bool mips_legitimize_move PARAMS ((enum machine_mode,
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 int mips_reg_mode_ok_for_base_p PARAMS ((rtx,
enum machine_mode,
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 45802fbd3d5..754a69dcbd4 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -881,6 +881,8 @@ const struct mips_cpu_info mips_cpu_info_table[] = {
#define TARGET_RTX_COSTS mips_rtx_costs
#undef TARGET_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
#define TARGET_ENCODE_SECTION_INFO mips_encode_section_info
@@ -2193,23 +2195,11 @@ mips_legitimize_move (mode, dest, src)
}
-/* Simplify an address for dwarf debugging info. The main purpose of
- this function is to convert GOT references back into symbolic form.
-
- 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. */
+/* Convert GOT and GP-relative accesses back into their original form.
+ Used by bothh TARGET_DELEGITIMIZE_ADDRESS and FIND_BASE_TERM. */
rtx
-mips_simplify_dwarf_addr (x)
+mips_delegitimize_address (x)
rtx x;
{
struct mips_constant_info c;
@@ -2219,6 +2209,14 @@ mips_simplify_dwarf_addr (x)
&& mips_classify_constant (&c, XEXP (XEXP (x, 0), 1)) == CONSTANT_RELOC
&& mips_classify_symbol (XVECEXP (c.symbol, 0, 0)) == SYMBOL_GOT_GLOBAL)
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;
}
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 5477b20497e..c645f10a35a 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -1348,7 +1348,7 @@ extern int mips_abi;
SFmode register saves. */
#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. */
#define PUT_SDB_SCL(a) \
OpenPOWER on IntegriCloud