[backport from gcc-4.8/trunk r185971, fixes PR53700 ] Date: Thu, 29 Mar 2012 13:28:36 -0400 From: Vladimir Makarov Subject: patch to fix a bug in coloring in multi-register allocnos presence. List-Archive: Frederic Riss sent me IRA dump files for an in-house GCC back-end which helped to find a bug in coloring in presence of multi-register allocnos. The bug resulted in making allocno colorable too earlier and as a consequence in worse code. The problem was in preventing processing of all conflicting objects of an allocno although the impact of each object was taken as 1. It was my mistake in merging code for IRA coloring without cover classes and Bernd's work on multi-object allocnos. The following patch changes SPEC2000 code on x86 (32-bit mode) for vpr, gcc, crafty, parser, and vortex and improves scores (up to 0.7% for crafty) and decrease code size (up to 0.5% for crafty) for these benchmarks. Frederic Riss also reported considerable improvements for his back-end. The patch was successfully bootstrapped on x86/x86-64 and committed as rev. 185971. gcc/ 2012-03-29 Vladimir Makarov * ira-color.c (setup_left_conflict_sizes_p): Process all conflicting objects. --- gcc-4.7.1/gcc/ira-color.c.~1~ 2012-02-22 00:27:59.000000000 +0100 +++ gcc-4.7.1/gcc/ira-color.c 2012-06-17 14:02:46.000000000 +0200 @@ -821,7 +821,6 @@ setup_left_conflict_sizes_p (ira_allocno node_preorder_num = node->preorder_num; COPY_HARD_REG_SET (node_set, node->hard_regs->set); node_check_tick++; - curr_allocno_process++; for (k = 0; k < nobj; k++) { ira_object_t obj = ALLOCNO_OBJECT (a, k); @@ -838,12 +837,10 @@ setup_left_conflict_sizes_p (ira_allocno conflict_data = ALLOCNO_COLOR_DATA (conflict_a); if (! ALLOCNO_COLOR_DATA (conflict_a)->in_graph_p - || conflict_data->last_process == curr_allocno_process || ! hard_reg_set_intersect_p (profitable_hard_regs, conflict_data ->profitable_hard_regs)) continue; - conflict_data->last_process = curr_allocno_process; conflict_node = conflict_data->hard_regs_node; COPY_HARD_REG_SET (conflict_node_set, conflict_node->hard_regs->set); if (hard_reg_set_subset_p (node_set, conflict_node_set))