On 5/15/26 5:18 AM, Stefan Schulze Frielinghaus wrote:
From: Stefan Schulze Frielinghaus <[email protected]> For the attached test we end up during IRA with 6: r99:DI=`s' REG_EQUIV `s' 7: {[`b']=asm_operands; [const(`s'+0x4)]=asm_operands; [`a']=asm_operands;clobber flags:CC;} REG_DEAD r99:DI REG_UNUSED flags:CC where r99 is used in each asm_operands (mem/c:SI (plus:DI (reg/f:DI 99) (const_int 4 [0x4])) [2 s.d+0 S4 A32]) This in turn means that we hit multiple times the very same insn while iterating over all uses of r99 which in the end triggers the assert. This patch relaxes the assert since what we want to ensure here is that a register is not used by multiple insns since otherwise we cannot trivially move or delete the definition. PR rtl-optimization/125173 gcc/ChangeLog: * ira.cc (combine_and_move_insns): Allow multiple uses within an insn. gcc/testsuite/ChangeLog: * gcc.dg/pr125173-1.c: New test. --- Notes: Bootstrapped and regtested on - aarch64-unknown-linux-gnu - powerpc64le-unknown-linux-gnu - s390x-ibm-linux-gnu - x86_64-pc-linux-gnu Ok for mainline?
Sorry for delay with the answer (I was on 2 week vacation). It is mostly Alan Modra's code but he retired 2 year ago. The patch is ok for me. Thank you for fixing it.
