diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2016-03-12 14:56:24 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2016-03-12 14:56:24 +0000 |
commit | cefe08a4ec4ff2e8dadfc26f89e70be5a3f21a1f (patch) | |
tree | 89175bb87f020eb40814bf5bb4015c266618b554 /gcc/lra-constraints.c | |
parent | 70112e2a64f7cbeddb9a1155e6cb65e188f6d7e3 (diff) | |
download | gcc-cefe08a4ec4ff2e8dadfc26f89e70be5a3f21a1f.zip gcc-cefe08a4ec4ff2e8dadfc26f89e70be5a3f21a1f.tar.gz gcc-cefe08a4ec4ff2e8dadfc26f89e70be5a3f21a1f.tar.bz2 |
re PR target/69614 (wrong code with -Os -fno-expensive-optimizations -fschedule-insns -mtpcs-leaf-frame -fira-algorithm=priority @ armv7a)
2016-03-12 Vladimir Makarov <vmakarov@redhat.com>
PR target/69614
* lra-constraints.c (delete_move_and_clobber): New.
(remove_inheritance_pseudos): Use it.
2016-03-12 Vladimir Makarov <vmakarov@redhat.com>
PR target/69614
* gcc.target/arm/pr69614.c: New.
From-SVN: r234162
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r-- | gcc/lra-constraints.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index ef18100..b070218 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -5850,6 +5850,24 @@ get_regno (rtx reg) return -1; } +/* Delete a move INSN with destination reg DREGNO and a previous + clobber insn with the same regno. The inheritance/split code can + generate moves with preceding clobber and when we delete such moves + we should delete the clobber insn too to keep the correct life + info. */ +static void +delete_move_and_clobber (rtx_insn *insn, int dregno) +{ + rtx_insn *prev_insn = PREV_INSN (insn); + + lra_set_insn_deleted (insn); + lra_assert (dregno > 0); + if (prev_insn != NULL && NONDEBUG_INSN_P (prev_insn) + && GET_CODE (PATTERN (prev_insn)) == CLOBBER + && dregno == get_regno (XEXP (PATTERN (prev_insn), 0))) + lra_set_insn_deleted (prev_insn); +} + /* Remove inheritance/split pseudos which are in REMOVE_PSEUDOS and return true if we did any change. The undo transformations for inheritance looks like @@ -5922,7 +5940,7 @@ remove_inheritance_pseudos (bitmap remove_pseudos) ? "split" : "inheritance"); dump_insn_slim (lra_dump_file, curr_insn); } - lra_set_insn_deleted (curr_insn); + delete_move_and_clobber (curr_insn, dregno); done_p = true; } else if (bitmap_bit_p (remove_pseudos, sregno) @@ -6122,7 +6140,7 @@ undo_optional_reloads (void) INSN_UID (insn)); dump_insn_slim (lra_dump_file, insn); } - lra_set_insn_deleted (insn); + delete_move_and_clobber (insn, REGNO (dest)); continue; } /* We should not worry about generation memory-memory |