===================================================================
@@ -6045,7 +6045,7 @@ rs6000_legitimize_tls_address (rtx addr,
/* Return 1 if X contains a thread-local symbol. */
-bool
+static bool
rs6000_tls_referenced_p (rtx x)
{
if (! TARGET_HAVE_TLS)
@@ -6059,6 +6059,11 @@ rs6000_tls_referenced_p (rtx x)
static bool
rs6000_cannot_force_const_mem (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x)
{
+ if (GET_CODE (x) == CONST
+ && GET_CODE (XEXP (x, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (x, 0), 1)) == HIGH)
+ return true;
+
return rs6000_tls_referenced_p (x);
}
===================================================================
@@ -171,7 +171,6 @@ extern unsigned int rs6000_dbx_register_
extern void rs6000_emit_epilogue (int);
extern void rs6000_emit_eh_reg_restore (rtx, rtx);
extern const char * output_isel (rtx *);
-extern bool rs6000_tls_referenced_p (rtx);
extern void rs6000_aix_asm_output_dwarf_table_ref (char *);
The 4.6 patch is a little different due to 4.5 not already having
rs6000_cannot_force_const_mem.
* config/rs6000/rs6000.c (rs6000_cannot_force_const_mem): New func.
(TARGET_CANNOT_FORCE_CONST_MEM): Update definition.
===================================================================
@@ -1212,6 +1212,7 @@ static enum machine_mode rs6000_eh_retur
static bool rs6000_can_eliminate (const int, const int);
static void rs6000_conditional_register_usage (void);
static void rs6000_trampoline_init (rtx, tree, rtx);
+static bool rs6000_cannot_force_const_mem (rtx);
/* Hash table stuff for keeping track of TOC entries. */
@@ -1382,7 +1383,7 @@ static const struct default_options rs60
#define TARGET_HAVE_TLS HAVE_AS_TLS
#undef TARGET_CANNOT_FORCE_CONST_MEM
-#define TARGET_CANNOT_FORCE_CONST_MEM rs6000_tls_referenced_p
+#define TARGET_CANNOT_FORCE_CONST_MEM rs6000_cannot_force_const_mem
#undef TARGET_DELEGITIMIZE_ADDRESS
#define TARGET_DELEGITIMIZE_ADDRESS rs6000_delegitimize_address
@@ -6651,6 +6663,19 @@ rs6000_tls_referenced_p (rtx x)
return for_each_rtx (&x, &rs6000_tls_symbol_ref_1, 0);
}
+/* Implement TARGET_CANNOT_FORCE_CONST_MEM. */
+
+static bool
+rs6000_cannot_force_const_mem (rtx x)
+{
+ if (GET_CODE (x) == CONST
+ && GET_CODE (XEXP (x, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (x, 0), 1)) == HIGH)
+ return true;
+
+ return rs6000_tls_referenced_p (x);
+}
+
/* Return 1 if *X is a thread-local symbol. This is the same as
rs6000_tls_symbol_ref except for the type of the unused argument. */