diff options
| author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-12-11 18:01:09 +0000 |
|---|---|---|
| committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-12-11 18:01:09 +0000 |
| commit | 136e5c8e07300dbec3ef9b4ee5442a649b239793 (patch) | |
| tree | e6e5397b14a9a35d92d2010b6261c51a1195d6a4 | |
| parent | d2fd2706c1df9b8ec827aa7fd47a0fb95c96d6e0 (diff) | |
| download | ppe42-gcc-136e5c8e07300dbec3ef9b4ee5442a649b239793.tar.gz ppe42-gcc-136e5c8e07300dbec3ef9b4ee5442a649b239793.zip | |
PR rtl-optimization/55193
* lra-constraints.c (loc_equivalence_callback): New function.
(lra_constraints): Call simplify_replace_fn_rtx instead of
loc_equivalence_change_p on DEBUG_INSNs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194405 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/lra-constraints.c | 29 |
2 files changed, 32 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c815e9f2d20..432d7102af4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-12-11 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/55193 + * lra-constraints.c (loc_equivalence_callback): New function. + (lra_constraints): Call simplify_replace_fn_rtx instead of + loc_equivalence_change_p on DEBUG_INSNs. + 2012-12-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com> PR target/55642 diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 2045b00e022..e4c9ca2a5e8 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -3186,6 +3186,21 @@ loc_equivalence_change_p (rtx *loc) return result; } +/* Similar to loc_equivalence_change_p, but for use as + simplify_replace_fn_rtx callback. */ +static rtx +loc_equivalence_callback (rtx loc, const_rtx, void *) +{ + if (!REG_P (loc)) + return NULL_RTX; + + rtx subst = get_equiv_substitution (loc); + if (subst != loc) + return subst; + + return NULL_RTX; +} + /* Maximum allowed number of constraint pass iterations after the last spill pass. It is for preventing LRA cycling in a bug case. */ #define MAX_CONSTRAINT_ITERATION_NUMBER 30 @@ -3422,11 +3437,17 @@ lra_constraints (bool first_p) /* We need to check equivalence in debug insn and change pseudo to the equivalent value if necessary. */ curr_id = lra_get_insn_recog_data (curr_insn); - if (bitmap_bit_p (&equiv_insn_bitmap, INSN_UID (curr_insn)) - && loc_equivalence_change_p (curr_id->operand_loc[0])) + if (bitmap_bit_p (&equiv_insn_bitmap, INSN_UID (curr_insn))) { - lra_update_insn_regno_info (curr_insn); - changed_p = true; + rtx old = *curr_id->operand_loc[0]; + *curr_id->operand_loc[0] + = simplify_replace_fn_rtx (old, NULL_RTX, + loc_equivalence_callback, NULL); + if (old != *curr_id->operand_loc[0]) + { + lra_update_insn_regno_info (curr_insn); + changed_p = true; + } } } else if (INSN_P (curr_insn)) |

