]> git.ipfire.org Git - thirdparty/gcc.git/commit
recog: Fix propagation into ASM_OPERANDS
authorRichard Sandiford <richard.sandiford@arm.com>
Fri, 27 Oct 2023 15:37:11 +0000 (16:37 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Fri, 27 Oct 2023 15:37:11 +0000 (16:37 +0100)
commit2672c60917d12260154de5d7bf668c55f2a0e62e
treec664f268a1987c6dbf51a177bcfa5f95ac418cec
parent6ff8b93c7b0bf3913fb7754f9985e7e31c46d89c
recog: Fix propagation into ASM_OPERANDS

An inline asm with multiple output operands is represented as a
parallel set in which the SET_SRCs are the same (shared) ASM_OPERANDS.
insn_propagation didn't account for this, and instead propagated
into each ASM_OPERANDS individually.  This meant that it could
apply a substitution X->Y to Y itself, which (a) could create
circularity and (b) would be semantically wrong in any case,
since Y might use a different value of X.

This patch checks explicitly for parallels involving ASM_OPERANDS,
just like combine does.

gcc/
* recog.cc (insn_propagation::apply_to_pattern_1): Handle shared
ASM_OPERANDS.
gcc/recog.cc