diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-12-11 19:01:09 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2012-12-11 19:01:09 +0100 |
commit | d0608e59b8fb862175eb6527228f433e708453b6 (patch) | |
tree | e6e5397b14a9a35d92d2010b6261c51a1195d6a4 /gcc | |
parent | 0ab19cbc7a46a3d3846e475a83f01717995e4bd4 (diff) | |
download | gcc-d0608e59b8fb862175eb6527228f433e708453b6.zip gcc-d0608e59b8fb862175eb6527228f433e708453b6.tar.gz gcc-d0608e59b8fb862175eb6527228f433e708453b6.tar.bz2 |
re PR rtl-optimization/55193 (ICE in in simplify_const_unary_operation, at simplify-rtx.c:1659)
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.
From-SVN: r194405
Diffstat (limited to 'gcc')
-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 c815e9f..432d710 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 2045b00..e4c9ca2 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)) |