diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-10 22:08:02 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-10 22:08:02 +0000 |
commit | 18df8ffd69db44738e648ae8bb4c71021df5c4e4 (patch) | |
tree | e7a992f6a52ec72ded4feb8bd83d59305db148f7 | |
parent | 2c1d4003d45e14d30de7cb25288a0c011333c0af (diff) | |
download | gcc-18df8ffd69db44738e648ae8bb4c71021df5c4e4.tar.gz |
* config/sparc/sparc.c (sparc_delegitimize_address): New function.
(TARGET_DELEGITIMIZE_ADDRESS): Define to above.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166563 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.c | 21 |
2 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 16920f3715d..037598e03e9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-11-10 Eric Botcazou <ebotcazou@adacore.com> + + * config/sparc/sparc.c (sparc_delegitimize_address): New function. + (TARGET_DELEGITIMIZE_ADDRESS): Define to above. + 2010-11-10 Quentin Neill <quentin.neill.gnu@gmail.com> * config.gcc (i[34567]86-*-*): Include tbmintrin.h. diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index afea74c7270..d9b1323ff21 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -420,6 +420,7 @@ static bool sparc_tls_referenced_p (rtx); static rtx sparc_legitimize_tls_address (rtx); static rtx sparc_legitimize_pic_address (rtx, rtx); static rtx sparc_legitimize_address (rtx, rtx, enum machine_mode); +static rtx sparc_delegitimize_address (rtx); static bool sparc_mode_dependent_address_p (const_rtx); static bool sparc_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool); @@ -524,6 +525,8 @@ static const struct default_options sparc_option_optimization_table[] = #undef TARGET_LEGITIMIZE_ADDRESS #define TARGET_LEGITIMIZE_ADDRESS sparc_legitimize_address +#undef TARGET_DELEGITIMIZE_ADDRESS +#define TARGET_DELEGITIMIZE_ADDRESS sparc_delegitimize_address #undef TARGET_MODE_DEPENDENT_ADDRESS_P #define TARGET_MODE_DEPENDENT_ADDRESS_P sparc_mode_dependent_address_p @@ -3568,6 +3571,24 @@ sparc_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, return x; } +/* Delegitimize an address that was legitimized by the above function. */ + +static rtx +sparc_delegitimize_address (rtx x) +{ + x = delegitimize_mem_from_attrs (x); + + if (GET_CODE (x) == LO_SUM + && GET_CODE (XEXP (x, 1)) == UNSPEC + && XINT (XEXP (x, 1), 1) == UNSPEC_TLSLE) + { + x = XVECEXP (XEXP (x, 1), 0, 0); + gcc_assert (GET_CODE (x) == SYMBOL_REF); + } + + return x; +} + /* SPARC implementation of LEGITIMIZE_RELOAD_ADDRESS. Returns a value to replace the input X, or the original X if no replacement is called for. The output parameter *WIN is 1 if the calling macro should goto WIN, |