This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ICE in ira.c
Hello,
>
> Not really an ICE!
Right, sorry about that.
Looks like the code is assuming that all backends use at
> least one define_register_constraint. (Also, there's a missing '\n' that
> probably makes your generated definition of REG_CLASS_FROM_CONSTRAINT
look a
> bit odd!) How about something like the attached (caution, untested -
> bootstrap still in progress)? Let me know if it fixes the problem for
you (it
> won't get exercised on any target I'm set up to build for) and I'll
submit it
> to -patches.
Yes, the patch solves the problem (please note that I manually applied
it to my version as I've got some FAILs when applying it automatically)
Thanks,
Revital
>
> cheers,
> DaveK
> Index: genpreds.c
> ===================================================================
> --- genpreds.c (revision 146543)
> +++ genpreds.c (working copy)
> @@ -1279,9 +1279,13 @@
> 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: ira.c
> ===================================================================
> --- ira.c (revision 146543)
> +++ ira.c (working copy)
> @@ -756,7 +756,7 @@
> continue;
> #ifdef CONSTRAINT__LIMIT
> for (j = 0; j < CONSTRAINT__LIMIT; j++)
> - if ((int) regclass_for_constraint (j) == i)
> + if ((int) REG_CLASS_FOR_CONSTRAINT (j) == i)
> break;
> if (j < CONSTRAINT__LIMIT)
> {