diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2014-07-26 09:47:33 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2014-07-26 09:47:33 +0000 |
commit | 093a6c996efdb16e7cf20f2677dbe128e618031d (patch) | |
tree | cfe6d5164490a03236fafa60c8d95b2fe0ded477 | |
parent | 82e3a7199574db824fc468831c6db6378fb7f87e (diff) | |
download | gcc-093a6c996efdb16e7cf20f2677dbe128e618031d.zip gcc-093a6c996efdb16e7cf20f2677dbe128e618031d.tar.gz gcc-093a6c996efdb16e7cf20f2677dbe128e618031d.tar.bz2 |
rtl.h (tls_referenced_p): Declare.
gcc/
* rtl.h (tls_referenced_p): Declare.
* rtlanal.c (tls_referenced_p_1, tls_referenced_p): New functions.
* config/mips/mips.c (mips_tls_symbol_ref_1): Delete.
(mips_cannot_force_const_mem): Use tls_referenced_p.
* config/pa/pa-protos.h (pa_tls_referenced_p): Delete.
* config/pa/pa.h (CONSTANT_ADDRESS_P): Use tls_referenced_p
instead of pa_tls_referenced_p.
* config/pa/pa.c (hppa_legitimize_address, pa_cannot_force_const_mem)
(pa_emit_move_sequence, pa_emit_move_sequence): Likewise.
(pa_legitimate_constant_p): Likewise.
(pa_tls_symbol_ref_1, pa_tls_referenced_p): Delete.
* config/rs6000/rs6000.c (rs6000_tls_referenced_p): Delete.
(rs6000_cannot_force_const_mem, rs6000_emit_move)
(rs6000_address_for_altivec): Use tls_referenced_p instead of
rs6000_tls_referenced_p.
(rs6000_tls_symbol_ref_1): Delete.
From-SVN: r213077
-rw-r--r-- | gcc/ChangeLog | 19 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 11 | ||||
-rw-r--r-- | gcc/config/pa/pa-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/pa/pa.c | 29 | ||||
-rw-r--r-- | gcc/config/pa/pa.h | 2 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 27 | ||||
-rw-r--r-- | gcc/rtl.h | 1 | ||||
-rw-r--r-- | gcc/rtlanal.c | 19 |
8 files changed, 49 insertions, 60 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9013ce8..6cf5364 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,22 @@ +2014-07-26 Richard Sandiford <rdsandiford@googlemail.com> + + * rtl.h (tls_referenced_p): Declare. + * rtlanal.c (tls_referenced_p_1, tls_referenced_p): New functions. + * config/mips/mips.c (mips_tls_symbol_ref_1): Delete. + (mips_cannot_force_const_mem): Use tls_referenced_p. + * config/pa/pa-protos.h (pa_tls_referenced_p): Delete. + * config/pa/pa.h (CONSTANT_ADDRESS_P): Use tls_referenced_p + instead of pa_tls_referenced_p. + * config/pa/pa.c (hppa_legitimize_address, pa_cannot_force_const_mem) + (pa_emit_move_sequence, pa_emit_move_sequence): Likewise. + (pa_legitimate_constant_p): Likewise. + (pa_tls_symbol_ref_1, pa_tls_referenced_p): Delete. + * config/rs6000/rs6000.c (rs6000_tls_referenced_p): Delete. + (rs6000_cannot_force_const_mem, rs6000_emit_move) + (rs6000_address_for_altivec): Use tls_referenced_p instead of + rs6000_tls_referenced_p. + (rs6000_tls_symbol_ref_1): Delete. + 2014-07-26 Marc Glisse <marc.glisse@inria.fr> PR target/44551 diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 3876da8..d8654c4 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -2171,15 +2171,6 @@ mips_symbol_insns (enum mips_symbol_type type, enum machine_mode mode) return mips_symbol_insns_1 (type, mode) * (TARGET_MIPS16 ? 2 : 1); } -/* A for_each_rtx callback. Stop the search if *X references a - thread-local symbol. */ - -static int -mips_tls_symbol_ref_1 (rtx *x, void *data ATTRIBUTE_UNUSED) -{ - return mips_tls_symbol_p (*x); -} - /* Implement TARGET_CANNOT_FORCE_CONST_MEM. */ static bool @@ -2223,7 +2214,7 @@ mips_cannot_force_const_mem (enum machine_mode mode, rtx x) } /* TLS symbols must be computed by mips_legitimize_move. */ - if (for_each_rtx (&x, &mips_tls_symbol_ref_1, NULL)) + if (tls_referenced_p (x)) return true; return false; diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h index 2659dcd..e72abea 100644 --- a/gcc/config/pa/pa-protos.h +++ b/gcc/config/pa/pa-protos.h @@ -54,7 +54,6 @@ extern void pa_output_global_address (FILE *, rtx, int); extern void pa_print_operand (FILE *, rtx, int); extern void pa_encode_label (rtx); extern int pa_symbolic_expression_p (rtx); -extern bool pa_tls_referenced_p (rtx); extern int pa_adjust_insn_length (rtx, int); extern int pa_fmpyaddoperands (rtx *); extern int pa_fmpysuboperands (rtx *); diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index e136741..d52d52f 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -1037,7 +1037,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_tls_referenced_p (x)) + if (tls_referenced_p (x)) return legitimize_tls_address (x); else if (flag_pic) return legitimize_pic_address (x, mode, gen_reg_rtx (Pmode)); @@ -1542,31 +1542,12 @@ force_mode (enum machine_mode mode, rtx orig) return gen_rtx_REG (mode, REGNO (orig)); } -/* Return 1 if *X is a thread-local symbol. */ - -static int -pa_tls_symbol_ref_1 (rtx *x, void *data ATTRIBUTE_UNUSED) -{ - return PA_SYMBOL_REF_TLS_P (*x); -} - -/* Return 1 if X contains a thread-local symbol. */ - -bool -pa_tls_referenced_p (rtx x) -{ - if (!TARGET_HAVE_TLS) - return false; - - return for_each_rtx (&x, &pa_tls_symbol_ref_1, 0); -} - /* Implement TARGET_CANNOT_FORCE_CONST_MEM. */ static bool pa_cannot_force_const_mem (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x) { - return pa_tls_referenced_p (x); + return tls_referenced_p (x); } /* Emit insns to move operands[1] into operands[0]. @@ -1921,7 +1902,7 @@ pa_emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg) || (GET_CODE (operand1) == HIGH && symbolic_operand (XEXP (operand1, 0), mode)) || function_label_operand (operand1, VOIDmode) - || pa_tls_referenced_p (operand1)) + || tls_referenced_p (operand1)) { int ishighonly = 0; @@ -2081,7 +2062,7 @@ pa_emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg) } return 1; } - else if (pa_tls_referenced_p (operand1)) + else if (tls_referenced_p (operand1)) { rtx tmp = operand1; rtx addend = NULL; @@ -10293,7 +10274,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_tls_referenced_p (x)) + if (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 3f9f06b..7292d6a 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -797,7 +797,7 @@ extern int may_call_alloca; ((GET_CODE (X) == LABEL_REF \ || (GET_CODE (X) == SYMBOL_REF && !SYMBOL_REF_TLS_MODEL (X)) \ || GET_CODE (X) == CONST_INT \ - || (GET_CODE (X) == CONST && !pa_tls_referenced_p (X)) \ + || (GET_CODE (X) == CONST && !tls_referenced_p (X)) \ || GET_CODE (X) == HIGH) \ && (reload_in_progress || reload_completed \ || ! pa_symbolic_expression_p (X))) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index b52b8a1..8b6e45d 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1101,7 +1101,6 @@ static void is_altivec_return_reg (rtx, void *); int easy_vector_constant (rtx, enum machine_mode); static rtx rs6000_debug_legitimize_address (rtx, rtx, enum machine_mode); static rtx rs6000_legitimize_tls_address (rtx, enum tls_model); -static int rs6000_tls_symbol_ref_1 (rtx *, void *); static int rs6000_get_some_local_dynamic_name_1 (rtx *, void *); static rtx rs6000_darwin64_record_arg (CUMULATIVE_ARGS *, const_tree, bool, bool); @@ -7254,17 +7253,6 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) return dest; } -/* Return 1 if X contains a thread-local symbol. */ - -static bool -rs6000_tls_referenced_p (rtx x) -{ - if (! TARGET_HAVE_TLS) - return false; - - return for_each_rtx (&x, &rs6000_tls_symbol_ref_1, 0); -} - /* Implement TARGET_CANNOT_FORCE_CONST_MEM. */ static bool @@ -7282,16 +7270,7 @@ rs6000_cannot_force_const_mem (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x) return true; /* Do not place an ELF TLS symbol in the constant pool. */ - return TARGET_ELF && 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. */ - -static int -rs6000_tls_symbol_ref_1 (rtx *x, void *data ATTRIBUTE_UNUSED) -{ - return RS6000_SYMBOL_REF_TLS_P (*x); + return TARGET_ELF && tls_referenced_p (x); } /* Return true iff the given SYMBOL_REF refers to a constant pool entry @@ -8240,7 +8219,7 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) /* Recognize the case where operand[1] is a reference to thread-local data and load its address to a register. */ - if (rs6000_tls_referenced_p (operands[1])) + if (tls_referenced_p (operands[1])) { enum tls_model model; rtx tmp = operands[1]; @@ -32441,7 +32420,7 @@ rs6000_address_for_altivec (rtx x) static bool rs6000_legitimate_constant_p (enum machine_mode mode, rtx x) { - if (TARGET_ELF && rs6000_tls_referenced_p (x)) + if (TARGET_ELF && tls_referenced_p (x)) return false; return ((GET_CODE (x) != CONST_DOUBLE && GET_CODE (x) != CONST_VECTOR) @@ -2292,6 +2292,7 @@ extern int replace_label (rtx *, void *); extern int rtx_referenced_p (rtx, rtx); extern bool tablejump_p (const_rtx, rtx *, rtx *); extern int computed_jump_p (const_rtx); +extern bool tls_referenced_p (rtx); typedef int (*rtx_function) (rtx *, void *); extern int for_each_rtx (rtx *, rtx_function, void *); diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 82cfc1bf..c513ec1 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -5960,3 +5960,22 @@ get_index_code (const struct address_info *info) return SCRATCH; } + +/* Return 1 if *X is a thread-local symbol. */ + +static int +tls_referenced_p_1 (rtx *x, void *) +{ + return GET_CODE (*x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (*x) != 0; +} + +/* Return true if X contains a thread-local symbol. */ + +bool +tls_referenced_p (rtx x) +{ + if (!targetm.have_tls) + return false; + + return for_each_rtx (&x, &tls_referenced_p_1, 0); +} |