diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2002-09-26 18:21:10 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@gcc.gnu.org> | 2002-09-26 18:21:10 +0000 |
commit | 6cabe79eabc995c20a16ce121cb42d3409b7364c (patch) | |
tree | 28ef776ce2bd8bfee4bf8e535b34d00c7fd7d71f /gcc | |
parent | 0855247a1c2c7feb135bedccff3e17103598169d (diff) | |
download | gcc-6cabe79eabc995c20a16ce121cb42d3409b7364c.zip gcc-6cabe79eabc995c20a16ce121cb42d3409b7364c.tar.gz gcc-6cabe79eabc995c20a16ce121cb42d3409b7364c.tar.bz2 |
reload.c (dup_replacements): New function.
* reload.c (dup_replacements): New function.
(find_reloads): Use it to duplicate replacements at the top level
of match_dup operands.
From-SVN: r57542
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/reload.c | 24 |
2 files changed, 27 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ffa7da4..bad6e89 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-09-26 Ulrich Weigand <uweigand@de.ibm.com> + + * reload.c (dup_replacements): New function. + (find_reloads): Use it to duplicate replacements at the top level + of match_dup operands. + 2002-09-26 Miles Bader <miles@gnu.org> * v850.md ("length"): Change default value to 4. diff --git a/gcc/reload.c b/gcc/reload.c index e522e55..39cf4e0 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -244,6 +244,7 @@ static enum reg_class find_valid_class PARAMS ((enum machine_mode, int, unsigned int)); static int reload_inner_reg_of_subreg PARAMS ((rtx, enum machine_mode)); static void push_replacement PARAMS ((rtx *, int, enum machine_mode)); +static void dup_replacements PARAMS ((rtx *, rtx *)); static void combine_reloads PARAMS ((void)); static int find_reusable_reload PARAMS ((rtx *, rtx, enum reg_class, enum reload_type, int, int)); @@ -1563,6 +1564,25 @@ push_replacement (loc, reloadnum, mode) r->mode = mode; } } + +/* Duplicate any replacement we have recorded to apply at + location ORIG_LOC to also be performed at DUP_LOC. + This is used in insn patterns that use match_dup. */ + +static void +dup_replacements (dup_loc, orig_loc) + rtx *dup_loc; + rtx *orig_loc; +{ + int i, n = n_replacements; + + for (i = 0; i < n; i++) + { + struct replacement *r = &replacements[i]; + if (r->where == orig_loc) + push_replacement (dup_loc, r->what, r->mode); + } +} /* Transfer all replacements that used to be in reload FROM to be in reload TO. */ @@ -3979,9 +3999,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) { int opno = recog_data.dup_num[i]; *recog_data.dup_loc[i] = *recog_data.operand_loc[opno]; - if (operand_reloadnum[opno] >= 0) - push_replacement (recog_data.dup_loc[i], operand_reloadnum[opno], - insn_data[insn_code_number].operand[opno].mode); + dup_replacements (recog_data.dup_loc[i], recog_data.operand_loc[opno]); } #if 0 |