On 11/13/2013, 12:56 PM, Vladimir Makarov wrote:

2013-11-13  Vladimir Makarov  <vmaka...@redhat.com>

    PR rtl-optimization/59036
        * ira-color.c (struct allocno_color_data): Add new members
        first_thread_allocno, next_thread_allocno, thread_freq.
        (sorted_copies): New static var.
(allocnos_conflict_by_live_ranges_p, copy_freq_compare_func): Move
        up.
        (allocno_thread_conflict_p, merge_threads)
        (form_threads_from_copies, form_threads_from_bucket)
        (form_threads_from_colorable_allocno, init_allocno_threads): New
        functions.
        (bucket_allocno_compare_func): Add comparison by thread frequency
        and threads.
        (add_allocno_to_ordered_bucket): Rename to
        add_allocno_to_ordered_colorable_bucket.  Remove parameter.
        (push_only_colorable): Call form_threads_from_bucket.
        (color_pass): Call init_allocno_threads.  Use
        consideration_allocno_bitmap instead of coloring_allocno_bitmap
        for nuillify allocno color data.
        (ira_initiate_assign, ira_finish_assign): Allocate/free
        sorted_copies.
        (coalesce_allocnos): Use static sorted copies.


Sorry, I did not check reload based targets and this patch broke them. The following patch fixes it.

Committed as rev. 204771.

2013-11-13  Vladimir Makarov  <vmaka...@redhat.com>

        * ira-color.c (coalesce_allocnos): Don't allocate and free
        sorted_copies.

Index: ira-color.c
===================================================================
--- ira-color.c (revision 204767)
+++ ira-color.c (working copy)
@@ -3725,8 +3725,6 @@ coalesce_allocnos (void)
   int i, n, cp_num, regno;
   bitmap_iterator bi;
 
-  sorted_copies = (ira_copy_t *) ira_allocate (ira_copies_num
-                                              * sizeof (ira_copy_t));
   cp_num = 0;
   /* Collect copies.  */
   EXECUTE_IF_SET_IN_BITMAP (coloring_allocno_bitmap, 0, j, bi)
@@ -3790,7 +3788,6 @@ coalesce_allocnos (void)
        }
       cp_num = n;
     }
-  ira_free (sorted_copies);
 }
 
 /* Usage cost and order number of coalesced allocno set to which

Reply via email to