]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/lra-spills.c
re PR rtl-optimization/69847 (Spec 2006 403.gcc slows down with -mlra vs. reload...
[thirdparty/gcc.git] / gcc / lra-spills.c
index 7e5f63785a0d1fe96b97d08bf8087b3b17b9c0f7..1801b7bb391d50f9880b49e2ec84477736e55b27 100644 (file)
@@ -693,7 +693,7 @@ lra_final_code_change (void)
 {
   int i, hard_regno;
   basic_block bb;
-  rtx_insn *insn, *curr;
+  rtx_insn *insn, *curr, *next_insn;
   int max_regno = max_reg_num ();
 
   for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
@@ -727,7 +727,12 @@ lra_final_code_change (void)
          if (NONJUMP_INSN_P (insn) && GET_CODE (pat) == SET
              && REG_P (SET_SRC (pat)) && REG_P (SET_DEST (pat))
              && REGNO (SET_SRC (pat)) == REGNO (SET_DEST (pat))
-             && ! return_regno_p (REGNO (SET_SRC (pat))))
+             && (! return_regno_p (REGNO (SET_SRC (pat)))
+                 || (next_insn = next_nondebug_insn (insn)) == NULL_RTX
+                 || ! INSN_P (next_insn)
+                 || GET_CODE (PATTERN (next_insn)) != USE
+                 || ! REG_P (XEXP (PATTERN (next_insn), 0))
+                 || REGNO (SET_SRC (pat)) != REGNO (XEXP (PATTERN (next_insn), 0))))
            {
              lra_invalidate_insn_data (insn);
              delete_insn (insn);