diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2010-11-10 22:08:02 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2010-11-10 22:08:02 +0000 |
commit | 8e7a6ed68c18117b0b248bccd932b5a477d2f8c2 (patch) | |
tree | e7a992f6a52ec72ded4feb8bd83d59305db148f7 | |
parent | 94d13ad18df325e53e10c4ed44dde8b60c4f6708 (diff) | |
download | gcc-8e7a6ed68c18117b0b248bccd932b5a477d2f8c2.zip gcc-8e7a6ed68c18117b0b248bccd932b5a477d2f8c2.tar.gz gcc-8e7a6ed68c18117b0b248bccd932b5a477d2f8c2.tar.bz2 |
sparc.c (sparc_delegitimize_address): New function.
* config/sparc/sparc.c (sparc_delegitimize_address): New function.
(TARGET_DELEGITIMIZE_ADDRESS): Define to above.
From-SVN: r166563
-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 16920f3..037598e 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 afea74c..d9b1323 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, |