The following patch makes gcc4.7 behaving as gcc4.6 for the case
described on http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49936.
The patch was successfully bootstrapped on x86_64 and ppc64.
Committed as rev 177916.
2011-08-19 Vladimir Makarov <vmaka...@redhat.com>
PR rtl-optimization/49936
* ira.c (ira_init_register_move_cost): Ignore too small subclasses
for calculation of max register move costs.
Index: ira.c
===================================================================
--- ira.c (revision 177573)
+++ ira.c (working copy)
@@ -1501,6 +1501,10 @@ ira_init_register_move_cost (enum machin
sizeof (move_table) * N_REG_CLASSES);
for (cl1 = 0; cl1 < N_REG_CLASSES; cl1++)
{
+ /* Some subclasses are to small to have enough registers to hold
+ a value of MODE. Just ignore them. */
+ if (! contains_reg_of_mode[cl1][mode])
+ continue;
COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl1]);
AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
if (hard_reg_set_empty_p (temp_hard_regset))