On 07/06/2016 01:42 PM, Andrew Burgess wrote:
* Richard Sandiford <richard.sandif...@arm.com> [2016-07-04 09:47:20 +0100]:
Thanks for removing the duplicated error check for unknown predicates.
I think that error gets reported later though, so we should check for
null here:

      return pred && pred->special;

OK with that change, thanks.

Richard,

Thanks for the continued reviews.  I don't have GCC write access, so I
wonder if you would be willing to commit this patch for me please.

There's an updated version below that includes the latest change you
suggested.

Many thanks,
Andrew

---

[PATCH] gcc/genrecog: Don't warn for missing mode on special predicates

In md.texi it says:

  Predicates written with @code{define_special_predicate} do not get any
  automatic mode checks, and are treated as having special mode handling
  by @command{genrecog}.

In genrecog, when validating a SET pattern, there is already a special
case for 'address_operand' which is a special predicate, however,
other special predicates fall through to the code which checks for
incorrect use of VOIDmode.

This commit adds a new function for detecting special predicates, and
then generalises the check in validate_pattern so that mode checking
is skipped for all special predicates.

gcc/ChangeLog:

        * genrecog.c (special_predicate_operand_p): New function.
        (predicate_name): Move function.
        (validate_pattern): Don't warn about missing mode for all
        define_special_predicate predicates.
Committed.  THanks,

jeff

Reply via email to