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 2/2] gcc/genrecog: Don't warn for missing mode on special predicates


Andrew Burgess <andrew.burgess@embecosm.com> writes:
> +/* Return true if OPERAND is a MATCH_OPERAND using a special predicate
> +   function.  */
> +
> +static bool
> +special_predicate_operand_p (rtx operand)
> +{
> +  if (GET_CODE (operand) == MATCH_OPERAND)
> +    {
> +      const char *pred_name = predicate_name (operand);
> +      if (pred_name[0] != 0)
> +	{
> +	  const struct pred_data *pred;
> +
> +	  pred = lookup_predicate (pred_name);
> +	  return pred->special;

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


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