https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127585
Drea Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Target| |m68k
Last reconfirmed| |2026-09-24
Status|UNCONFIRMED |NEW
--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
```
Trying 25 -> 26:
25: r44:SI=[r38:SI+0x4]&0x800000
26: pc={(r44:SI!=0)?L49:pc}
REG_DEAD r44:SI
REG_BR_PROB 59055801
Successfully matched this instruction:
(set (pc)
(if_then_else (ne (zero_extract:SI (mem/v:SI (plus:SI (reg/f:SI 38 [ _29 ])
(const_int 4 [0x4])) [4 MEM[(volatile u32D.2148 *)_29 +
4B]+0 S4 A16])
(const_int 1 [0x1])
(const_int 8 [0x8]))
(const_int 0 [0]))
(label_ref 49)
(pc)))
allowing combination of insns 25 and 26
original costs 14 + 15 = 29
replacement cost 23
deferring deletion of insn with uid = 25.
modifying insn i3 26: pc={(zero_extract([r38:SI+0x4],0x1,0x8)!=0)?L49:pc}
REG_BR_PROB 59055801
deferring rescan insn with uid = 26.
```
```
(jump_insn 26 25 27 5 (set (pc)
(if_then_else (ne (zero_extract:SI (mem/v:SI (plus:SI (reg/f:SI 38 [
_29 ])
(const_int 4 [0x4])) [4 MEM[(volatile u32D.2148
*)_29 + 4B]+0 S4 A16])
(const_int 1 [0x1])
(const_int 8 [0x8]))
(const_int 0 [0]))
(label_ref 49)
(pc))) "/app/example.cpp":51:4 27 {cbranchsi4_btst_reg_insn_1}
(int_list:REG_BR_PROB 59055801 (nil))
-> 49)
```
```
;; Nonoffsettable mem refs are ok in this one pattern
;; since we don't try to adjust them.
(define_insn "cbranchsi4_btst_mem_insn_1"
[(set (pc)
(if_then_else (match_operator 0 "equality_comparison_operator"
[(zero_extract:SI (match_operand:QI 1 "memory_operand"
"m")
(const_int 1)
(match_operand:SI 2
"const_int_operand" "n"))
(const_int 0)])
(label_ref (match_operand 3 ""))
(pc)))]
"!TARGET_COLDFIRE && (unsigned) INTVAL (operands[2]) < 8"
{
rtx_code code = GET_CODE (operands[0]);
operands[2] = GEN_INT (7 - INTVAL (operands[2]));
code = m68k_output_btst (operands[2], operands[1], code, 7);
return m68k_output_branch_integer (code);
})
```
I noticed there are other places which would need to be audited in the 68k
backend. So -ffuse-ops-with-volatile-access should just be turned off for 68k.