diff options
author | Joern Rennecke <amylaar@spamcop.net> | 2010-01-29 23:14:57 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@spamcop.net> | 2010-01-29 23:14:57 +0000 |
commit | 155323b7bd4a34d2f85b348dd119a318a82c4e7b (patch) | |
tree | dce068cde63866fe925e7f19c8a82ec37f41e57c | |
parent | 8a7b1e8b09d0ec6f80ba8dfbea7a64e7ac9042c5 (diff) |
* explow.c (memory_address_addr_space): Call legitimate_addressmpost-opt-imp-20100127
hook also in the cse-driven case.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/mpost-opt-imp-20100127@156368 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.mpost | 3 | ||||
-rw-r--r-- | gcc/explow.c | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ChangeLog.mpost b/gcc/ChangeLog.mpost index ed373b6446a..fccd6bc3913 100644 --- a/gcc/ChangeLog.mpost +++ b/gcc/ChangeLog.mpost @@ -29,6 +29,9 @@ * opts.c (decode_options): Initialize flag_tree_pre_partial_partial. * tree-ssa-pre.c (execute_pre): Use flag_tree_pre_partial_partial. + * explow.c (memory_address_addr_space): Call legitimate_address + hook also in the cse-driven case. + 2010-01-27 Joern Rennecke <amylaar@spamcop.net> PR tree-optimization/39141 diff --git a/gcc/explow.c b/gcc/explow.c index 1f66f3e7705..901a58a8609 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -425,7 +425,14 @@ memory_address_addr_space (enum machine_mode mode, rtx x, addr_space_t as) /* By passing constant addresses through registers we get a chance to cse them. */ if (! cse_not_expected && CONSTANT_P (x) && CONSTANT_ADDRESS_P (x)) - x = force_reg (address_mode, x); + { + /* If the target has offset addressing and a suitable + TARGET_LEGITIMIZE_ADDRESS definition, that can give much better + cse. */ + x = targetm.addr_space.legitimize_address (x, oldx, mode, as); + + x = force_reg (address_mode, x); + } /* We get better cse by rejecting indirect addressing at this stage. Let the combiner create indirect addresses where appropriate. |