diff mbox

[lra] patch to fix a bootstrap failure on SPARC64

Message ID 4F43E0C1.3010104@redhat.com
State New
Headers show

Commit Message

Vladimir Makarov Feb. 21, 2012, 6:21 p.m. UTC
The SPARC bootstrap started to fail after recent addition of live range 
splitting and trunk merge. The following patch fixes a crash of GCC on 
SPARC64 bootstrap.  Unfortunately, it is still not enough to fix the 
bootstrap failure but I am working on it.

The patch was successfully bootstrapped on x86/x86-64.

Committed as rev. 184444.

2012-02-21  Vladimir Makarov <vmakarov@redhat.com>

         * lra-constraints.c (inherit_in_ebb): Put split save before jump
         using the pseudo.
diff mbox

Patch

Index: lra-constraints.c
===================================================================
--- lra-constraints.c	(revision 184315)
+++ lra-constraints.c	(working copy)
@@ -4407,8 +4407,11 @@  inherit_in_ebb (rtx head, rtx tail)
 		  }
 		else if (reg_renumber[src_regno] >= 0)
 		  {
+		    bool before_p;
 		    rtx use_insn = curr_insn;
 
+		    before_p = (JUMP_P (curr_insn)
+				|| (CALL_P (curr_insn) && reg->type == OP_IN));
 		    if (usage_insns[src_regno].check == curr_usage_insns_check
 			&& (next_usage_insns
 			    = usage_insns[src_regno].insns) != NULL_RTX
@@ -4422,8 +4425,7 @@  inherit_in_ebb (rtx head, rtx tail)
 			&& need_for_split_p (potential_reload_hard_regs,
 					     src_regno)
 			&& NONDEBUG_INSN_P (curr_insn)
-			&& split_pseudo (CALL_P (curr_insn) && reg->type == OP_IN,
-					 src_regno, curr_insn,
+			&& split_pseudo (before_p, src_regno, curr_insn,
 					 next_usage_insns))
 		      {
 			if (reg->subreg_p)
@@ -4431,7 +4433,7 @@  inherit_in_ebb (rtx head, rtx tail)
 			change_p = true;
 			/* Invalidate.  */
 			usage_insns[src_regno].check = 0;
-			if (CALL_P (curr_insn) && reg->type == OP_IN)
+			if (before_p)
 			  use_insn = PREV_INSN (curr_insn);
 		      }
 		    if (NONDEBUG_INSN_P (curr_insn))