]> git.ipfire.org Git - thirdparty/gcc.git/commit
[LRA]: Don't reuse chosen insn alternative with special memory constraint
authorVladimir N. Makarov <vmakarov@redhat.com>
Thu, 7 Sep 2023 13:59:10 +0000 (09:59 -0400)
committerVladimir N. Makarov <vmakarov@redhat.com>
Thu, 7 Sep 2023 14:04:11 +0000 (10:04 -0400)
commitf7bca44d97ad01b39f9d6e7809df7bf517eeb2fb
tree663c6e73aad70edb9bb22e2b01a2da4fd0f271fa
parent6aba1fa7a4ceaf66adc587da23834d1f317f871d
[LRA]: Don't reuse chosen insn alternative with special memory constraint

To speed up GCC, LRA reuses chosen alternative from previous
constraint subpass.  A spilled pseudo is considered ok for any memory
constraint although stack slot assigned to the pseudo later might not
satisfy the chosen alternative constraint.  As we don't consider all insn
alternatives on the subsequent LRA sub-passes, it might result in LRA failure
to generate the correct insn.  This patch solves the problem.

gcc/ChangeLog:

PR target/111225
* lra-constraints.cc (goal_reuse_alt_p): New global flag.
(process_alt_operands): Set up the flag.  Clear flag for chosen
alternative with special memory constraints.
(process_alt_operands): Set up used insn alternative depending on the flag.

gcc/testsuite/ChangeLog:

PR target/111225
* gcc.target/i386/pr111225.c: New test.
gcc/lra-constraints.cc
gcc/testsuite/gcc.target/i386/pr111225.c [new file with mode: 0644]