]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PR114942][LRA]: Don't reuse input reload reg of inout early clobber operand
authorVladimir N. Makarov <vmakarov@redhat.com>
Fri, 10 May 2024 13:15:50 +0000 (09:15 -0400)
committerUros Bizjak <ubizjak@gmail.com>
Thu, 28 Nov 2024 15:57:53 +0000 (16:57 +0100)
commit196ab7853ef5dc225833a914491add0a3adeaf9d
tree146952cfc52ab01cce093d932eae820700984d7d
parent3161e4c2da91652c9a28e79cbf74dfee2201095f
[PR114942][LRA]: Don't reuse input reload reg of inout early clobber operand

  The insn in question has the same reg in inout operand and input
operand.  The inout operand is early clobber.  LRA reused input reload
reg of the inout operand for the input operand which is wrong.  It
were a good decision if the inout operand was not early clobber one.
The patch rejects the reuse for the PR test case.

gcc/ChangeLog:

PR target/114942
* lra-constraints.cc (struct input_reload): Add new member early_clobber_p.
(get_reload_reg): Add new arg early_clobber_p, don't reuse input
reload with true early_clobber_p member value, use the arg for new
element of curr_insn_input_reloads.
(match_reload): Assign false to early_clobber_p member.
(process_addr_reg, simplify_operand_subreg, curr_insn_transform):
Adjust get_reload_reg calls.

gcc/testsuite/ChangeLog:

PR target/114942
* gcc.target/i386/pr114942.c: New.

(cherry picked from commit 9585317f0715699197b1313bbf939c6ea3c1ace6)
gcc/lra-constraints.cc
gcc/testsuite/gcc.target/i386/pr114942.c [new file with mode: 0644]