This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix bootstrap fail on spu vs. ira.c/genpreds


Vladimir Makarov wrote:
>> gcc/ChangeLog
>>
>>     * ira.c (setup_cover_and_important_classes):  Use safe macro
>>     REG_CLASS_FOR_CONSTRAINT instead of calling regclass_for_constraint
>>     directly.
>>     * genpreds.c (write_tm_preds_h):  Output suitable definition of
>>     REG_CLASS_FOR_CONSTRAINT.

> The patch posted in
> 
> http://gcc.gnu.org/ml/gcc/2009-04/msg00698.html
> 
> is done for older version of ira.c.

  Oops, yes; I updated it before I started the build, here's the current version.

> Other than that the patch is ok.  Although, personally, I'd prefer the 
> following patch (because it does not create a new macro which is used only
> in one place of the compiler):

  Your solution is clean, but if anyone ever wants to call
regclass_for_constraint again in the future we might run into the same problem
again, might we not?  I don't really mind which patch goes in, it's your call.

    cheers,
      DaveK


Index: gcc/ira.c
===================================================================
--- gcc/ira.c	(revision 146838)
+++ gcc/ira.c	(working copy)
@@ -756,7 +756,7 @@ setup_cover_and_important_classes (void)
 	    continue;
 #ifdef CONSTRAINT_NUM_DEFINED_P
 	  for (j = 0; j < CONSTRAINT__LIMIT; j++)
-	    if ((int) regclass_for_constraint ((enum constraint_num) j) == i)
+	    if ((int) REG_CLASS_FOR_CONSTRAINT ((enum constraint_num) j) == i)
 	      break;
 	  if (j < CONSTRAINT__LIMIT)
 	    {
Index: gcc/genpreds.c
===================================================================
--- gcc/genpreds.c	(revision 146838)
+++ gcc/genpreds.c	(working copy)
@@ -1280,9 +1280,13 @@ write_tm_preds_h (void)
 	puts ("extern enum reg_class regclass_for_constraint "
 	      "(enum constraint_num);\n"
 	      "#define REG_CLASS_FROM_CONSTRAINT(c_,s_) \\\n"
-	      "    regclass_for_constraint (lookup_constraint (s_))\n");
+	      "    regclass_for_constraint (lookup_constraint (s_))\n"
+	      "#define REG_CLASS_FOR_CONSTRAINT(x_) \\\n"
+	      "    regclass_for_constraint (x_)\n");
       else
-	puts ("#define REG_CLASS_FROM_CONSTRAINT(c_,s_) NO_REGS");
+	puts ("#define REG_CLASS_FROM_CONSTRAINT(c_,s_) NO_REGS\n"
+	      "#define REG_CLASS_FOR_CONSTRAINT(x_) \\\n"
+	      "    NO_REGS\n");
       if (have_const_int_constraints)
 	puts ("extern bool insn_const_int_ok_for_constraint "
 	      "(HOST_WIDE_INT, enum constraint_num);\n"

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]