diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2024-10-22 11:51:44 +0200 |
---|---|---|
committer | Georg-Johann Lay <avr@gjlay.de> | 2024-10-24 22:35:43 +0200 |
commit | ca0ab7a0ac18911181e9161cfb8b87fb90039612 (patch) | |
tree | 8b555766239429cea2beb990067c9d16ce450311 /gcc | |
parent | ecd6bee0913db1237424ea68b0b1ec252b024e9c (diff) | |
download | gcc-ca0ab7a0ac18911181e9161cfb8b87fb90039612.zip gcc-ca0ab7a0ac18911181e9161cfb8b87fb90039612.tar.gz gcc-ca0ab7a0ac18911181e9161cfb8b87fb90039612.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/avr/avr.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc index 735d05b..b69a9c2 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) |