diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-22 14:35:39 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-22 14:35:39 +0000 |
commit | 4a77f173f5669858966e37bbd313af1ce381a273 (patch) | |
tree | 5e8be93a1ed7e5ab1d8f77ae6ad3c77be61ad195 /gcc/ree.c | |
parent | 45e74a244a3323236688277783c2fc5d56ad38ef (diff) | |
download | gcc-4a77f173f5669858966e37bbd313af1ce381a273.tar.gz |
PR rtl-optimization/51924
* ree.c (combine_set_extension): Improve debugging message.
(combine_reaching_defs): Likewise.
(get_defs): Rename confusingly named variable.
(find_and_remove_re): Skip a candidate if the extension expression has
been modified.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183390 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ree.c')
-rw-r--r-- | gcc/ree.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/gcc/ree.c b/gcc/ree.c index 48113a966ba..4cab20ed50e 100644 --- a/gcc/ree.c +++ b/gcc/ree.c @@ -346,7 +346,8 @@ combine_set_extension (ext_cand *cand, rtx curr_insn, rtx *orig_set) { if (dump_file) { - fprintf (dump_file, "Merged instruction with extension:\n"); + fprintf (dump_file, + "Tentatively merged extension with definition:\n"); print_rtl_single (dump_file, curr_insn); } return true; @@ -407,21 +408,21 @@ transform_ifelse (ext_cand *cand, rtx def_insn) static struct df_link * get_defs (rtx insn, rtx reg, VEC (rtx,heap) **dest) { - df_ref reg_info, *defs; + df_ref reg_info, *uses; struct df_link *ref_chain, *ref_link; reg_info = NULL; - for (defs = DF_INSN_USES (insn); *defs; defs++) + for (uses = DF_INSN_USES (insn); *uses; uses++) { - reg_info = *defs; + reg_info = *uses; if (GET_CODE (DF_REF_REG (reg_info)) == SUBREG) return NULL; if (REGNO (DF_REF_REG (reg_info)) == REGNO (reg)) break; } - gcc_assert (reg_info != NULL && defs != NULL); + gcc_assert (reg_info != NULL && uses != NULL); ref_chain = DF_REF_CHAIN (reg_info); @@ -686,11 +687,10 @@ combine_reaching_defs (ext_cand *cand, rtx set_pat) purposes. This extension cannot be deleted. */ if (dump_file) { - FOR_EACH_VEC_ELT (rtx, vec, i, def_insn) - { - fprintf (dump_file, "Non-mergeable definitions:\n"); - print_rtl_single (dump_file, def_insn); - } + fprintf (dump_file, + "Merge cancelled, non-mergeable definitions:\n"); + FOR_EACH_VEC_ELT (rtx, vec, i, def_insn) + print_rtl_single (dump_file, def_insn); } } } @@ -843,6 +843,12 @@ find_and_remove_re (void) { num_re_opportunities++; + /* If the candidate insn is itself a definition insn for another + candidate, it may have been modified and the UD chain broken. + FIXME: the handling of successive extensions can be improved. */ + if (!reg_mentioned_p (curr_cand->expr, PATTERN (curr_cand->insn))) + continue; + /* Try to combine the extension with the definition. */ if (dump_file) { |