]> 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)
committerVladimir N. Makarov <vmakarov@redhat.com>
Fri, 10 May 2024 16:29:29 +0000 (12:29 -0400)
commit9585317f0715699197b1313bbf939c6ea3c1ace6
tree8bdcf1480e14973626f42eba5ec6800d57005632
parentcbd420a1c3e2bb549dc83b53cc9a31aa6b23952c
[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.
gcc/lra-constraints.cc
gcc/testsuite/gcc.target/i386/pr114942.c [new file with mode: 0644]