rs6000: Skip debug insns for union [PR105627]
authorKewen Lin <linkw@linux.ibm.com>
Tue, 24 May 2022 06:00:22 +0000 (01:00 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Tue, 24 May 2022 06:00:22 +0000 (01:00 -0500)
commit149d04ccbb908b3a251485b43faf204752942b9f
treed3ff209c92b6ce00e98a20cd108eb7f3a7008b31
parent168fc8bda14e2ec24c17d19630cec29fc646ed2f
rs6000: Skip debug insns for union [PR105627]

As PR105627 exposes, pass analyze_swaps should skip debug
insn when doing unionfind_union.  One debug insn can use
several pseudos, if we take debug insn into account, we can
union those insns defining them and generate some unexpected
unions.

Based on the assumption that it's impossible to have one
pseudo which is defined by one debug insn but is used by one
nondebug insn, we just asserts debug insn never shows up in
function union_defs.

PR target/105627

gcc/ChangeLog:

* config/rs6000/rs6000-p8swap.cc (union_defs): Assert def_insn can't
be a debug insn.
(union_uses): Skip debug use_insn.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/pr105627.c: New test.
gcc/config/rs6000/rs6000-p8swap.cc
gcc/testsuite/gcc.target/powerpc/pr105627.c [new file with mode: 0644]