summaryrefslogtreecommitdiff
path: root/gcc/lra-constraints.c
diff options
context:
space:
mode:
authorvmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2016-03-12 14:56:24 +0000
committervmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2016-03-12 14:56:24 +0000
commit02ffd664c523d75bbb5be3163c0d4cba7f070dbd (patch)
tree89175bb87f020eb40814bf5bb4015c266618b554 /gcc/lra-constraints.c
parent76e207a91aed824957bb6829bade8ba71aba6977 (diff)
downloadgcc-02ffd664c523d75bbb5be3163c0d4cba7f070dbd.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234162 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r--gcc/lra-constraints.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index ef18100125d..b070218145a 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