aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/config/pa/pa.c16
-rw-r--r--gcc/config/pa/pa.h9
3 files changed, 27 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8d2e394..f15e847 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2014-02-04 John David Anglin <danglin@gcc.gnu.org>
+
+ PR target/59777
+ * config/pa/pa.c (legitimize_tls_address): Return original address
+ if not passed a SYMBOL_REF rtx.
+ (hppa_legitimize_address): Call legitimize_tls_address for all TLS
+ addresses.
+ (pa_emit_move_sequence): Simplify TLS source operands.
+ (pa_legitimate_constant_p): Reject all TLS constants.
+ * config/pa/pa.h (PA_SYMBOL_REF_TLS_P): Correct comment.
+ (CONSTANT_ADDRESS_P): Reject TLS CONST addresses.
+
2014-02-04 Jan Hubicka <hubicka@ucw.cz>
* ipa.c (function_and_variable_visibility): Decompose DECL_ONE_ONLY
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index c5f87ea..f9d4da0 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -916,9 +916,12 @@ static rtx
legitimize_tls_address (rtx addr)
{
rtx ret, insn, tmp, t1, t2, tp;
- enum tls_model model = SYMBOL_REF_TLS_MODEL (addr);
- switch (model)
+ /* Currently, we can't handle anything but a SYMBOL_REF. */
+ if (GET_CODE (addr) != SYMBOL_REF)
+ return addr;
+
+ switch (SYMBOL_REF_TLS_MODEL (addr))
{
case TLS_MODEL_GLOBAL_DYNAMIC:
tmp = gen_reg_rtx (Pmode);
@@ -1039,7 +1042,7 @@ hppa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
&& !REG_POINTER (XEXP (x, 1)))
return gen_rtx_PLUS (Pmode, XEXP (x, 1), XEXP (x, 0));
- if (PA_SYMBOL_REF_TLS_P (x))
+ if (pa_tls_referenced_p (x))
return legitimize_tls_address (x);
else if (flag_pic)
return legitimize_pic_address (x, mode, gen_reg_rtx (Pmode));
@@ -1920,9 +1923,10 @@ pa_emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
not consider them legitimate constants. Loop optimizations can
call the emit_move_xxx with one as a source. */
if ((GET_CODE (operand1) != HIGH && immediate_operand (operand1, mode))
- || function_label_operand (operand1, VOIDmode)
|| (GET_CODE (operand1) == HIGH
- && symbolic_operand (XEXP (operand1, 0), mode)))
+ && symbolic_operand (XEXP (operand1, 0), mode))
+ || function_label_operand (operand1, VOIDmode)
+ || pa_tls_referenced_p (operand1))
{
int ishighonly = 0;
@@ -10300,7 +10304,7 @@ pa_legitimate_constant_p (enum machine_mode mode, rtx x)
/* TLS_MODEL_GLOBAL_DYNAMIC and TLS_MODEL_LOCAL_DYNAMIC are not
legitimate constants. The other variants can't be handled by
the move patterns after reload starts. */
- if (PA_SYMBOL_REF_TLS_P (x))
+ if (pa_tls_referenced_p (x))
return false;
if (TARGET_64BIT && GET_CODE (x) == CONST_DOUBLE)
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 36d1388..ac3f0eb 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -784,9 +784,9 @@ extern int may_call_alloca;
#define MAX_REGS_PER_ADDRESS 2
-/* Non-TLS symbolic references. */
-#define PA_SYMBOL_REF_TLS_P(RTX) \
- (GET_CODE (RTX) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (RTX) != 0)
+/* TLS symbolic reference. */
+#define PA_SYMBOL_REF_TLS_P(X) \
+ (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (X) != 0)
/* Recognize any constant value that is a valid address except
for symbolic addresses. We get better CSE by rejecting them
@@ -796,7 +796,8 @@ extern int may_call_alloca;
#define CONSTANT_ADDRESS_P(X) \
((GET_CODE (X) == LABEL_REF \
|| (GET_CODE (X) == SYMBOL_REF && !SYMBOL_REF_TLS_MODEL (X)) \
- || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
+ || GET_CODE (X) == CONST_INT \
+ || (GET_CODE (X) == CONST && !pa_tls_referenced_p (X)) \
|| GET_CODE (X) == HIGH) \
&& (reload_in_progress || reload_completed \
|| ! pa_symbolic_expression_p (X)))