https://gcc.gnu.org/g:ca0ab7a0ac18911181e9161cfb8b87fb90039612
commit r15-4618-gca0ab7a0ac18911181e9161cfb8b87fb90039612 Author: Georg-Johann Lay <a...@gjlay.de> Date: Tue Oct 22 11:51:44 2024 +0200 AVR: target/116953 - Restore recog_data after calling jump_over_one_insn_p. The previous fix for PR116953 is incomplete because references to recog_data are escaping avr_out_sbxx_branch() in the form of %-operands in the returned asm code template. This patch reverts the previous fix, and re-extracts the operands by means of extract_constrain_insn_cached() after the call of jump_over_one_insn_p(). PR target/116953 gcc/ * config/avr/avr.cc (avr_out_sbxx_branch): Revert previous fix for PR116953 (r15-4078). Run extract_constrain_insn_cached on the current insn after calling jump_over_one_insn_p. Diff: --- gcc/config/avr/avr.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc index 735d05b1e747..b69a9c24aa0d 100644 --- a/gcc/config/avr/avr.cc +++ b/gcc/config/avr/avr.cc @@ -13603,16 +13603,16 @@ avr_hard_regno_rename_ok (unsigned int old_reg, unsigned int new_reg) Operand 3: label to jump to if the test is true. */ const char * -avr_out_sbxx_branch (rtx_insn *insn, rtx xop[]) +avr_out_sbxx_branch (rtx_insn *insn, rtx operands[]) { - // jump_over_one_insn_p may call extract on the next insn, clobbering - // recog_data.operand. Hence make a copy of the operands (PR116953). - rtx operands[] = { xop[0], xop[1], xop[2], xop[3] }; - rtx_code comp = GET_CODE (operands[0]); bool long_jump = get_attr_length (insn) >= 4; bool reverse = long_jump || jump_over_one_insn_p (insn, operands[3]); + // PR116953: jump_over_one_insn_p may call extract on the next insn, + // clobbering recog_data.operand. Thus, restore recog_data. + extract_constrain_insn_cached (insn); + if (comp == GE) comp = EQ; else if (comp == LT)