This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[lra] patch to fix full bootstrap for LRA


The following patch fixes a failure during x86 bootstrap with Java language. The first bug occurs when we have BB containing only debug insns. LRA before the patch did not update live info correctly during processing EBBs containing such BBs. The second bug was in assigning wrong mode for x86 fp stack register inside subreg in debug insn.

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

Committed as rev. 190629.

2012-08-23 Vladimir Makarov <vmakarov@redhat.com>

        * lra-constraints.c (update_ebb_live_info): Process debug insn
        too.

        * lra-spills.c (lra_hard_reg_substitution): Call alter_subreg with
        true only for non-debug insn.

Index: lra-spills.c
===================================================================
--- lra-spills.c	(revision 190448)
+++ lra-spills.c	(working copy)
@@ -590,7 +590,7 @@ lra_hard_reg_substitution (void)
 	      if (GET_CODE (op) == SUBREG && REG_P (SUBREG_REG (op)))
 		{
 		  lra_assert (REGNO (SUBREG_REG (op)) < FIRST_PSEUDO_REGISTER);
-		  alter_subreg (id->operand_loc[i], true);
+		  alter_subreg (id->operand_loc[i], ! DEBUG_INSN_P (insn));
 		  lra_update_dup (id, i);
 		  insn_change_p = true;
 		}
Index: lra-constraints.c
===================================================================
--- lra-constraints.c	(revision 190448)
+++ lra-constraints.c	(working copy)
@@ -4255,7 +4255,7 @@ update_ebb_live_info (rtx head, rtx tail
        curr_insn = prev_insn)
     {
       prev_insn = PREV_INSN (curr_insn);
-      if (! NONDEBUG_INSN_P (curr_insn))
+      if (! INSN_P (curr_insn))
 	continue;
       curr_bb = BLOCK_FOR_INSN (curr_insn);
       if (curr_bb != prev_bb)
@@ -4291,6 +4291,8 @@ update_ebb_live_info (rtx head, rtx tail
 	  prev_bb = curr_bb;
 	  bitmap_and (&live_regs, &check_only_regs, DF_LR_OUT (curr_bb));
 	}
+      if (DEBUG_INSN_P (curr_insn))
+	continue;
       curr_id = lra_get_insn_recog_data (curr_insn);
       remove_p = false;
       if ((set = single_set (curr_insn)) != NULL_RTX && REG_P (SET_DEST (set))

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]