diff options
author | Vladimir N. Makarov <vmakarov@redhat.com> | 2020-03-16 16:42:19 -0400 |
---|---|---|
committer | Vladimir N. Makarov <vmakarov@redhat.com> | 2020-03-16 16:42:19 -0400 |
commit | bae7b38cf8a21e068ad5c0bab089dedb78af3346 (patch) | |
tree | 81528af6fab8dc779f1d3565581128149cb27255 /gcc/lra-spills.c | |
parent | f522810d2b5edb4008afc4a8d003b7e182aa8ba2 (diff) | |
download | gcc-bae7b38cf8a21e068ad5c0bab089dedb78af3346.zip gcc-bae7b38cf8a21e068ad5c0bab089dedb78af3346.tar.gz gcc-bae7b38cf8a21e068ad5c0bab089dedb78af3346.tar.bz2 |
Fix PR94185: Do not reuse insn alternative after changing memory subreg.
2020-03-16 Vladimir Makarov <vmakarov@redhat.com>
PR target/94185
* lra-spills.c (remove_pseudos): Do not reuse insn alternative
after changing memory subreg.
2020-03-16 Vladimir Makarov <vmakarov@redhat.com>
PR target/94185
* g++.target/i386/pr94185.C: New test.
Diffstat (limited to 'gcc/lra-spills.c')
-rw-r--r-- | gcc/lra-spills.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/lra-spills.c b/gcc/lra-spills.c index 01256e7..a4b955a 100644 --- a/gcc/lra-spills.c +++ b/gcc/lra-spills.c @@ -427,7 +427,17 @@ remove_pseudos (rtx *loc, rtx_insn *insn) and avoid LRA cycling in case of subreg memory reload. */ res = remove_pseudos (&SUBREG_REG (*loc), insn); if (GET_CODE (SUBREG_REG (*loc)) == MEM) - alter_subreg (loc, false); + { + alter_subreg (loc, false); + if (GET_CODE (*loc) == MEM) + { + lra_get_insn_recog_data (insn)->used_insn_alternative = -1; + if (lra_dump_file != NULL) + fprintf (lra_dump_file, + "Memory subreg was simplified in in insn #%u\n", + INSN_UID (insn)); + } + } return res; } else if (code == REG && (i = REGNO (*loc)) >= FIRST_PSEUDO_REGISTER |