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]

RFA: patch solving pr37333


The following patch solves PR37333. The analysis of the problem can be found in

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37333

The patch was successfully bootstrapped on x86_64.

2008-09-06 Vladimir Makarov <vmakarov@redhat.com>

PR rtl-opt/37333
* ira-build.c (ira_create_allocno): Setup frequency to 0.


   * ira-color.c (update_conflict_hard_regno_costs): Remove assert.
   Check zero freq and increase if necessary.


Index: ira-color.c
===================================================================
--- ira-color.c	(revision 140052)
+++ ira-color.c	(working copy)
@@ -210,7 +210,7 @@ static void
 update_conflict_hard_regno_costs (int *costs, ira_allocno_t allocno,
 				  int divisor, bool decr_p)
 {
-  int i, cost, class_size, mult, div;
+  int i, cost, class_size, freq, mult, div;
   int *conflict_costs;
   bool cont_p;
   enum machine_mode mode;
@@ -258,9 +258,11 @@ update_conflict_hard_regno_costs (int *c
 	cont_p = true;
       else
 	{
-	  ira_assert (ALLOCNO_FREQ (another_allocno) != 0);
 	  mult = cp->freq;
-	  div = ALLOCNO_FREQ (another_allocno) * divisor;
+	  freq = ALLOCNO_FREQ (another_allocno);
+	  if (freq == 0)
+	    freq = 1;
+	  div = freq * divisor;
 	  cont_p = false;
 	  for (i = class_size - 1; i >= 0; i--)
 	    {
Index: ira-build.c
===================================================================
--- ira-build.c	(revision 140014)
+++ ira-build.c	(working copy)
@@ -443,7 +443,7 @@ ira_create_allocno (int regno, bool cap_
   COPY_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a), ira_no_alloc_regs);
   COPY_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), ira_no_alloc_regs);
   ALLOCNO_NREFS (a) = 0;
-  ALLOCNO_FREQ (a) = 1;
+  ALLOCNO_FREQ (a) = 0;
   ALLOCNO_HARD_REGNO (a) = -1;
   ALLOCNO_CALL_FREQ (a) = 0;
   ALLOCNO_CALLS_CROSSED_NUM (a) = 0;

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