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 to solve one PR37242 problem


The patch solves IR degradation on rethrow6.C reported in PR37242.

The analysis of the problem is in

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

The solution is to prevent assigning hard-registers to global allocnos for -O0 as the old register allocator does.

2008-08-27 Vladimir Makarov <vmakarov@redhat.com>

   PR rtl-opt/37243
   * ira-color (ira_fast_allocation): Don't assign hard registers to
   global allocnos.

Index: ira-color.c
===================================================================
--- ira-color.c	(revision 139597)
+++ ira-color.c	(working copy)
@@ -2912,13 +2912,17 @@ ira_fast_allocation (void)
   for (i = 0; i < num; i++)
     {
       a = sorted_allocnos[i];
+      ALLOCNO_ASSIGNED_P (a) = true;
+      ALLOCNO_HARD_REGNO (a) = -1;
+      /* Live info about hard registers are absent when OPTIMIZE==0.
+	 So try to assign hard-registers only to local allocnos.  */
+      if (!optimize && REG_BASIC_BLOCK (ALLOCNO_REGNO (a)) == REG_BLOCK_GLOBAL)
+	continue;
       COPY_HARD_REG_SET (conflict_hard_regs, ALLOCNO_CONFLICT_HARD_REGS (a));
       for (r = ALLOCNO_LIVE_RANGES (a); r != NULL; r = r->next)
 	for (j =  r->start; j <= r->finish; j++)
 	  IOR_HARD_REG_SET (conflict_hard_regs, used_hard_regs[j]);
       cover_class = ALLOCNO_COVER_CLASS (a);
-      ALLOCNO_ASSIGNED_P (a) = true;
-      ALLOCNO_HARD_REGNO (a) = -1;
       if (hard_reg_set_subset_p (reg_class_contents[cover_class],
 				 conflict_hard_regs))
 	continue;

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