diff options
author | J"orn Rennecke <amylaar@cygnus.co.uk> | 1999-03-24 13:44:58 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 1999-03-24 13:44:58 +0000 |
commit | 8593b74599267dec25b99d08db2e302852a3ccbc (patch) | |
tree | 91d6e1c979fdd24e9d2177953cc8f1723819ed18 /gcc | |
parent | 32ec3c9d86fdcd0e65a7a60a7b40b1ebdc51189f (diff) | |
download | gcc-8593b74599267dec25b99d08db2e302852a3ccbc.zip gcc-8593b74599267dec25b99d08db2e302852a3ccbc.tar.gz gcc-8593b74599267dec25b99d08db2e302852a3ccbc.tar.bz2 |
reload1.c (choose_reload_regs): If output-reloading for a simple move insn...
reload1.c (choose_reload_regs): If output-reloading for a
simple move insn, try to inherit an equivalence for the input.
From-SVN: r25946
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/reload1.c | 18 |
2 files changed, 22 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fba63e3..1dd7d63 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Wed Mar 24 21:42:15 1999 J"orn Rennecke <amylaar@cygnus.co.uk> + + reload1.c (choose_reload_regs): If output-reloading for a + simple move insn, try to inherit an equivalence for the input. + 1999-02-24 Mike Stump <mrs@wrs.com> * arm/aout.h (DBX_OUTPUT_MAIN_SOURCE_FILENAME): Fix quoting. diff --git a/gcc/reload1.c b/gcc/reload1.c index 621594a..c3d4e13 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -5808,6 +5808,7 @@ choose_reload_regs (chain) for (j = 0; j < n_reloads; j++) { register int r = reload_order[j]; + rtx search_equiv = NULL_RTX; /* Ignore reloads that got marked inoperative. */ if (reload_out[r] == 0 && reload_in[r] == 0 @@ -6037,9 +6038,23 @@ choose_reload_regs (chain) || GET_CODE (reload_in[r]) == MEM) && (reload_nregs[r] == max_group_size || ! reg_classes_intersect_p (reload_reg_class[r], group_class))) + search_equiv = reload_in[r]; + /* If this is an output reload from a simple move insn, look + if an equivalence for the input is available. */ + else if (inheritance && reload_in[r] == 0 && reload_out[r] != 0) + { + rtx set = single_set (insn); + + if (set + && rtx_equal_p (reload_out[r], SET_DEST (set)) + && CONSTANT_P (SET_SRC (set))) + search_equiv = SET_SRC (set); + } + + if (search_equiv) { register rtx equiv - = find_equiv_reg (reload_in[r], insn, reload_reg_class[r], + = find_equiv_reg (search_equiv, insn, reload_reg_class[r], -1, NULL_PTR, 0, reload_mode[r]); int regno; @@ -6302,6 +6317,7 @@ choose_reload_regs (chain) pass just to remove such reloads, make another pass, since the removal of one reload might allow us to inherit another one. */ else if ((! reload_out[r] || reload_out_reg[r]) + && reload_in[r] && remove_address_replacements (reload_in[r]) && pass) pass = 2; } |