[ was: Re: combination of read/write and earlyclobber constraint modifier ]

On 02-07-14 17:52, Jeff Law wrote:
(by the way, in the same aarch64-simd.md file, I noticed some
define_expand with constraints, that looks strange)
It sometimes happens when a define_insn is converted into a define_expand --
folks just forget to remove the pointless constraints.

I happened to come across some code that is trying to check for this case in validate_pattern in genrecog.c:
...
            /* In DEFINE_EXPAND, DEFINE_SPLIT, and DEFINE_PEEPHOLE2, we
               don't use the MATCH_OPERAND constraint, only the predicate.
               This is confusing to folks doing new ports, so help them
               not make the mistake.  */
            if (GET_CODE (insn) == DEFINE_EXPAND
                || GET_CODE (insn) == DEFINE_SPLIT
                || GET_CODE (insn) == DEFINE_PEEPHOLE2)
              {
                if (constraints0)
                  error_with_line (pattern_lineno,
                                   "constraints not supported in %s",
                                   rtx_name[GET_CODE (insn)]);
              }
...

But it doesn't triggered for define_expand, because validate_pattern is only used in genrecog.c, and define_expand is ignored in the main function.

Thanks,
- Tom

Reply via email to