]> git.ipfire.org Git - thirdparty/gcc.git/commit
regrename: Fix -fcompare-debug issue in check_new_reg_p [PR105041]
authorSurya Kumari Jangala <jskumari@linux.vnet.ibm.com>
Fri, 10 Jun 2022 14:22:57 +0000 (19:52 +0530)
committerSegher Boessenkool <segher@kernel.crashing.org>
Tue, 14 Jun 2022 17:36:48 +0000 (17:36 +0000)
commit3e16b4359e86b36676ed01219e6deafa95f3c16b
treeee1e2755b35b6b4a74c92fc6f2f8dc13268fb8e4
parente0e3ce634818b83965b87512938490df4d57f81d
regrename: Fix -fcompare-debug issue in check_new_reg_p [PR105041]

In check_new_reg_p, the nregs of a du chain is computed by obtaining the
MODE of the first element in the chain, and then calling
hard_regno_nregs() with the MODE. But the first element of the chain can
be a DEBUG_INSN whose mode need not be the same as the rest of the
elements in the du chain. This was resulting in fcompare-debug failure
as check_new_reg_p was returning a different result with -g for the same
candidate register. We can instead obtain nregs from the du chain
itself.

2022-06-10  Surya Kumari Jangala  <jskumari@linux.ibm.com>

gcc/
PR rtl-optimization/105041
* regrename.cc (check_new_reg_p): Use nregs value from du chain.

gcc/testsuite/
PR rtl-optimization/105041
* gcc.target/powerpc/pr105041.c: New test.
gcc/regrename.cc
gcc/testsuite/gcc.target/powerpc/pr105041.c [new file with mode: 0644]