Patchwork [lra] patch to fix a ppc64 gcc testsuite failure

login
register
mail settings
Submitter Vladimir Makarov
Date Aug. 8, 2012, 2:10 p.m.
Message ID <5022734C.6060707@redhat.com>
Download mbox | patch
Permalink /patch/175932/
State New
Headers show

Comments

Vladimir Makarov - Aug. 8, 2012, 2:10 p.m.
The following patch fixes a ppc64 gcc testsuite failure.

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

Committed as rev. 190207.

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

         * lra-int.h (lra_constraint_iter_after_spill): New.

         * lra.c (lra): Initialize lra_constraint_iter_after_spill.

         * lra-constraints.c (lra_constraint_iter_after_spill): New.
         (lra_constraints): Use lra_constraint_iter_after_spill.

Patch

Index: lra.c
===================================================================
--- lra.c	(revision 190127)
+++ lra.c	(working copy)
@@ -2118,7 +2118,8 @@  lra (FILE *f)
   COPY_HARD_REG_SET (lra_no_alloc_regs, ira_no_alloc_regs);
 
   lra_live_range_iter = lra_coalesce_iter = 0;
-  lra_constraint_iter = lra_inheritance_iter = lra_undo_inheritance_iter = 0;
+  lra_constraint_iter = lra_constraint_iter_after_spill = 0;
+  lra_inheritance_iter = lra_undo_inheritance_iter = 0;
 
   setup_reg_spill_flag ();
 
@@ -2214,6 +2215,7 @@  lra (FILE *f)
       lra_constraint_new_regno_start = max_reg_num ();
       lra_constraint_new_insn_uid_start = get_max_uid ();
       bitmap_clear (&lra_matched_pseudos);
+      lra_constraint_iter_after_spill = 0;
     }
   restore_scratches ();
   lra_eliminate (true);
Index: lra-constraints.c
===================================================================
--- lra-constraints.c	(revision 190127)
+++ lra-constraints.c	(working copy)
@@ -3460,8 +3460,8 @@  debug_loc_equivalence_change_p (rtx *loc
   return result;
 }
 
-/* Maximum number of constraint pass iteration number.  It is for
-   preventing all LRA cycling.  */
+/* Maximum number of constraint pass iteration number after the last
+   spill pass.  It is for preventing all LRA cycling.  */
 #define MAX_CONSTRAINT_ITERATION_NUMBER 15
 
 /* Maximum number of generated reload insns per an insn.  It is for
@@ -3471,6 +3471,10 @@  debug_loc_equivalence_change_p (rtx *loc
 /* The current iteration number of this LRA pass.  */
 int lra_constraint_iter;
 
+/* The current iteration number of this LRA pass after the last spill
+   pass.  */
+int lra_constraint_iter_after_spill;
+
 /* True if we substituted equiv which needs checking register
    allocation correctness because the equivalent value contains
    allocatiable hard registers or when we restore multi-register
@@ -3492,7 +3496,8 @@  lra_constraints (bool first_p)
   if (lra_dump_file != NULL)
     fprintf (lra_dump_file, "\n********** Local #%d: **********\n\n",
 	     lra_constraint_iter);
-  if (lra_constraint_iter > MAX_CONSTRAINT_ITERATION_NUMBER)
+  lra_constraint_iter_after_spill++;
+  if (lra_constraint_iter_after_spill > MAX_CONSTRAINT_ITERATION_NUMBER)
     internal_error
       ("Maximum number of LRA constraint passes is achieved (%d)\n",
        MAX_CONSTRAINT_ITERATION_NUMBER);
Index: lra-int.h
===================================================================
--- lra-int.h	(revision 190127)
+++ lra-int.h	(working copy)
@@ -296,6 +296,7 @@  extern rtx lra_secondary_memory[NUM_MACH
 extern int lra_constraint_offset (int, enum machine_mode);
 
 extern int lra_constraint_iter;
+extern int lra_constraint_iter_after_spill;
 extern bool lra_risky_transformations_p;
 extern int lra_inheritance_iter;
 extern int lra_undo_inheritance_iter;