This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFA: patch to solve PR 43413
- From: Vladimir Makarov <vmakarov at redhat dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: meissner at gcc dot gnu dot org, Jeffrey Law <law at redhat dot com>
- Date: Tue, 23 Mar 2010 14:48:06 -0400
- Subject: RFA: patch to solve PR 43413
The following patch solves PR43413. The details of the problem can be
found on
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43413
Is it ok for the trunk?
2010-03-23 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/43413
* ira-color.c (setup_allocno_available_regs_num): Count prohibited
hard regs too.
Index: ira-color.c
===================================================================
--- ira-color.c (revision 157673)
+++ ira-color.c (working copy)
@@ -1354,7 +1354,8 @@ pop_allocnos_from_stack (void)
static void
setup_allocno_available_regs_num (ira_allocno_t allocno)
{
- int i, n, hard_regs_num;
+ int i, n, hard_regs_num, hard_regno;
+ enum machine_mode mode;
enum reg_class cover_class;
ira_allocno_t a;
HARD_REG_SET temp_set;
@@ -1373,9 +1374,15 @@ setup_allocno_available_regs_num (ira_al
if (a == allocno)
break;
}
+ mode = ALLOCNO_MODE (allocno);
for (n = 0, i = hard_regs_num - 1; i >= 0; i--)
- if (TEST_HARD_REG_BIT (temp_set, ira_class_hard_regs[cover_class][i]))
- n++;
+ {
+ hard_regno = ira_class_hard_regs[cover_class][i];
+ if (TEST_HARD_REG_BIT (temp_set, hard_regno)
+ || TEST_HARD_REG_BIT (prohibited_class_mode_regs[cover_class][mode],
+ hard_regno))
+ n++;
+ }
if (internal_flag_ira_verbose > 2 && n > 0 && ira_dump_file != NULL)
fprintf (ira_dump_file, " Reg %d of %s has %d regs less\n",
ALLOCNO_REGNO (allocno), reg_class_names[cover_class], n);