diff options
author | Peter Bergner <bergner@linux.ibm.com> | 2023-03-17 19:01:45 -0500 |
---|---|---|
committer | Peter Bergner <bergner@linux.ibm.com> | 2023-03-17 19:02:33 -0500 |
commit | 44a13125a0d56dbabb9bc61de7ff8bf94fb57928 (patch) | |
tree | d4aaebc09bb2dcf9f2f85b665dc05e9ed6539fee | |
parent | ac81fea349b7af8a9aa1dc47b5f9a07a0f9a73f6 (diff) | |
download | gcc-44a13125a0d56dbabb9bc61de7ff8bf94fb57928.zip gcc-44a13125a0d56dbabb9bc61de7ff8bf94fb57928.tar.gz gcc-44a13125a0d56dbabb9bc61de7ff8bf94fb57928.tar.bz2 |
lra: Ignore debug insns and notes in combine_reload_insn [PR109179]
We ICE in combine_reload_insn if we've deleted the TO insn operand during
processing, because lra_get_insn_recog_data doesn't expect to see the note
that replaces the deleted insn. The solution here is to exit early if TO
is a debug insn or note.
2023-03-17 Peter Bergner <bergner@linux.ibm.com>
gcc/
PR rtl-optimization/109179
* lra-constraints.cc (combine_reload_insn): Enforce TO is not a debug
insn or note. Move the tests earlier to guard lra_get_insn_recog_data.
-rw-r--r-- | gcc/lra-constraints.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc index 95b534e..405b8b9 100644 --- a/gcc/lra-constraints.cc +++ b/gcc/lra-constraints.cc @@ -5014,14 +5014,19 @@ combine_reload_insn (rtx_insn *from, rtx_insn *to) enum reg_class to_class, from_class; int n, nop; signed char changed_nops[MAX_RECOG_OPERANDS + 1]; - lra_insn_recog_data_t id = lra_get_insn_recog_data (to); - struct lra_static_insn_data *static_id = id->insn_static_data; /* Check conditions for second memory reload and original insn: */ if ((targetm.secondary_memory_needed == hook_bool_mode_reg_class_t_reg_class_t_false) - || NEXT_INSN (from) != to || CALL_P (to) - || id->used_insn_alternative == LRA_UNKNOWN_ALT + || NEXT_INSN (from) != to + || !NONDEBUG_INSN_P (to) + || CALL_P (to)) + return false; + + lra_insn_recog_data_t id = lra_get_insn_recog_data (to); + struct lra_static_insn_data *static_id = id->insn_static_data; + + if (id->used_insn_alternative == LRA_UNKNOWN_ALT || (set = single_set (from)) == NULL_RTX) return false; from_reg = SET_DEST (set); |