aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@redhat.com>2002-10-01 10:22:07 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2002-10-01 10:22:07 +0000
commit366356d3e6d0d8a33d6a47a559607c3755dc3b65 (patch)
tree0bd83637e26e03e5d6015c58f4cf74f00e2c905c /gcc
parent8ab907e87cd30f515180b570a2178beaec93b4a4 (diff)
downloadgcc-366356d3e6d0d8a33d6a47a559607c3755dc3b65.zip
gcc-366356d3e6d0d8a33d6a47a559607c3755dc3b65.tar.gz
gcc-366356d3e6d0d8a33d6a47a559607c3755dc3b65.tar.bz2
mips.c (mips16_strings): New variable.
* config/mips/mips.c (mips16_strings): New variable. (mips_output_function_epilogue): Clear the SYMBOL_REF_FLAG of every symbol in mips16_strings. Free the list. (mips_encode_section_info): Keep track of local strings. From-SVN: r57685
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/mips/mips.c23
2 files changed, 29 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 32143e5..4d7631d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2002-10-01 Richard Sandiford <rsandifo@redhat.com>
+ * config/mips/mips.c (mips16_strings): New variable.
+ (mips_output_function_epilogue): Clear the SYMBOL_REF_FLAG of every
+ symbol in mips16_strings. Free the list.
+ (mips_encode_section_info): Keep track of local strings.
+
+2002-10-01 Richard Sandiford <rsandifo@redhat.com>
+
* config/mips/mips.md (bunge, bltgt, bungt): New define_expands.
(sordered_df, sordered_sf): Remove.
* config/mips/mips.c (get_float_compare_codes): New fn.
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 450de43..3729c43 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -367,6 +367,11 @@ char mips_hard_regno_mode_ok[(int)MAX_MACHINE_MODE][FIRST_PSEUDO_REGISTER];
constant pool is output. */
int mips_string_length;
+/* When generating mips16 code, a list of all strings that are to be
+ output after the current function. */
+
+static GTY(()) rtx mips16_strings;
+
/* In mips16 mode, we build a list of all the string constants we see
in a particular function. */
@@ -7711,6 +7716,7 @@ mips_output_function_epilogue (file, size)
HOST_WIDE_INT size ATTRIBUTE_UNUSED;
{
const char *fnname = ""; /* FIXME: Correct initialisation? */
+ rtx string;
#ifndef FUNCTION_NAME_ALREADY_DECLARED
/* Get the function name the same way that toplev.c does before calling
@@ -7775,6 +7781,17 @@ mips_output_function_epilogue (file, size)
string_constants = next;
}
+ /* If any following function uses the same strings as this one, force
+ them to refer those strings indirectly. Nearby functions could
+ refer them using pc-relative addressing, but it isn't safe in
+ general. For instance, some functions may be placed in sections
+ other than .text, and we don't know whether they be close enough
+ to this one. In large files, even other .text functions can be
+ too far away. */
+ for (string = mips16_strings; string != 0; string = XEXP (string, 1))
+ SYMBOL_REF_FLAG (XEXP (string, 0)) = 0;
+ free_EXPR_LIST_list (&mips16_strings);
+
/* Restore the output file if optimizing the GP (optimizing the GP causes
the text to be diverted to a tempfile, so that data decls come before
references to the data). */
@@ -8153,7 +8170,11 @@ mips_encode_section_info (decl, first)
&& (! current_function_decl
|| ! DECL_ONE_ONLY (current_function_decl)))
{
- SYMBOL_REF_FLAG (XEXP (TREE_CST_RTL (decl), 0)) = 1;
+ rtx symref;
+
+ symref = XEXP (TREE_CST_RTL (decl), 0);
+ mips16_strings = alloc_EXPR_LIST (0, symref, mips16_strings);
+ SYMBOL_REF_FLAG (symref) = 1;
mips_string_length += TREE_STRING_LENGTH (decl);
}
}