]> gcc.gnu.org Git - gcc.git/commit
lra: Avoid unfolded plus-0
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 19 Oct 2023 09:49:19 +0000 (10:49 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 19 Oct 2023 09:49:19 +0000 (10:49 +0100)
commit6a527b809f99d3f05df16f792b2de6b32fa0d579
tree917edcf392b5a6f7c1fd51fb3d0980857c73530a
parentece703162640102b9cc401451a8d39961254425c
lra: Avoid unfolded plus-0

While backporting another patch to an earlier release, I hit a
situation in which lra_eliminate_regs_1 would eliminate an address to:

    (plus (reg:P R) (const_int 0))

This address compared not-equal to plain:

    (reg:P R)

which caused an ICE in a later peephole2.  (The ICE showed up in
gfortran.fortran-torture/compile/pr80464.f90 on the branch but seems
to be latent on trunk.)

These unfolded PLUSes shouldn't occur in the insn stream, and later code
in the same function tried to avoid them.

gcc/
PR target/111528
* lra-eliminations.cc (lra_eliminate_regs_1): Use simplify_gen_binary
rather than gen_rtx_PLUS.

(cherry picked from commit 10d59b802a7db9ae908291fb20627c1493cfa26c)
gcc/lra-eliminations.cc
This page took 0.061205 seconds and 6 git commands to generate.