cc74938
2014-07-11  Vladimir Makarov  <vmakarov@redhat.com>
5a434b4
    
cc74938
	* lra-constraints.c (remove_inheritance_pseudos): Process
cc74938
	destination pseudo too.
5a434b4
cc74938
--- gcc/lra-constraints.c
cc74938
+++ gcc/lra-constraints.c
5a434b4
@@ -5697,6 +5697,20 @@ remove_inheritance_pseudos (bitmap remove_pseudos)
5a434b4
 			SUBREG_REG (SET_SRC (set)) = SET_SRC (prev_set);
5a434b4
 		      else
5a434b4
 			SET_SRC (set) = SET_SRC (prev_set);
5a434b4
+		      /* As we are finishing with processing the insn
5a434b4
+			 here, check the destination too as it might
5a434b4
+			 inheritance pseudo for another pseudo.  */
5a434b4
+		      if (bitmap_bit_p (remove_pseudos, dregno)
5a434b4
+			  && bitmap_bit_p (&lra_inheritance_pseudos, dregno)
5a434b4
+			  && (restore_regno
5a434b4
+			      = lra_reg_info[dregno].restore_regno) >= 0)
5a434b4
+			{
5a434b4
+			  if (GET_CODE (SET_DEST (set)) == SUBREG)
5a434b4
+			    SUBREG_REG (SET_DEST (set))
5a434b4
+			      = regno_reg_rtx[restore_regno];
5a434b4
+			  else
5a434b4
+			    SET_DEST (set) = regno_reg_rtx[restore_regno];
5a434b4
+			}
5a434b4
 		      lra_push_insn_and_update_insn_regno_info (curr_insn);
5a434b4
 		      lra_set_used_insn_alternative_by_uid
5a434b4
 			(INSN_UID (curr_insn), -1);