]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
AVR: target/116953 - Restore recog_data after calling jump_over_one_insn_p.
authorGeorg-Johann Lay <avr@gjlay.de>
Tue, 22 Oct 2024 09:51:44 +0000 (11:51 +0200)
committerGeorg-Johann Lay <avr@gjlay.de>
Thu, 24 Oct 2024 20:35:43 +0000 (22:35 +0200)
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.

gcc/config/avr/avr.cc

index 735d05b1e7477f5d4f19466e786301ce31dbc887..b69a9c24aa0db9a5b74e10fb9d4272d71cce7ed9 100644 (file)
@@ -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)