diff options
author | mkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-28 16:50:14 +0000 |
---|---|---|
committer | mkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-28 16:50:14 +0000 |
commit | 025406442d5fb4d840630da0da177c300b264750 (patch) | |
tree | 749f7fc6dfa2c824b07a8cb7966d3a3030a9f30e /gcc/gcse.c | |
parent | 6d0bf6d6a78b47891f0397395dc63d298a5189fb (diff) | |
download | gcc-025406442d5fb4d840630da0da177c300b264750.tar.gz |
PR rtl-optimization/45107
* gcse.c (hash_scan_set): Use max_distance for gcse-las.
PR rtl-optimization/45107
* gcc.dg/pr45107.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162645 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r-- | gcc/gcse.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c index 112413112f1..6e923f9d572 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -1471,6 +1471,7 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table_d *table) else if (flag_gcse_las && REG_P (src) && MEM_P (dest)) { unsigned int regno = REGNO (src); + int max_distance = 0; /* Do not do this for constant/copy propagation. */ if (! table->set_p @@ -1482,7 +1483,7 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table_d *table) do that easily for EH edges so disable GCSE on these for now. */ && !can_throw_internal (insn) /* Is SET_DEST something we want to gcse? */ - && want_to_gcse_p (dest, NULL) + && want_to_gcse_p (dest, &max_distance) /* Don't CSE a nop. */ && ! set_noop_p (pat) /* Don't GCSE if it has attached REG_EQUIV note. @@ -1504,7 +1505,7 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table_d *table) /* Record the memory expression (DEST) in the hash table. */ insert_expr_in_table (dest, GET_MODE (dest), insn, - antic_p, avail_p, 0, table); + antic_p, avail_p, max_distance, table); } } } |