The following patch solves PR 48331 and PR 48334. The problem was in that allocno profitable hard regs were not set up for priority colouring and function assign_hard_reg used a garbage in its decisions generating wrong code or code of awful quality.

Is it ok to commit?

2011-03-29  Vladimir Makarov <vmaka...@redhat.com>

        PR rtl-optimization/48331
        PR rtl-optimization/48334
        * ira-color.c (color_allocnos): Call setup_profitable_hard_regs
        for any used algorithm.

Index: ira-color.c
===================================================================
--- ira-color.c (revision 171682)
+++ ira-color.c (working copy)
@@ -2590,6 +2590,7 @@ color_allocnos (void)
   bitmap_iterator bi;
   ira_allocno_t a;
 
+  setup_profitable_hard_regs ();
   if (flag_ira_algorithm == IRA_ALGORITHM_PRIORITY)
     {
       n = 0;
@@ -2642,7 +2643,6 @@ color_allocnos (void)
     }
   else
     {
-      setup_profitable_hard_regs ();
       form_object_hard_regs_nodes_forest ();
       if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL)
        print_hard_regs_forest (ira_dump_file);

Reply via email to