This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
constraints in define_expand
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: Jeff Law <law at redhat dot com>, <gcc at gcc dot gnu dot org>
- Cc: Vladimir Makarov <vmakarov at redhat dot com>
- Date: Fri, 4 Jul 2014 10:07:20 +0200
- Subject: constraints in define_expand
- Authentication-results: sourceware.org; auth=none
- References: <53B30B96 dot 2000603 at mentor dot com> <53B31041 dot 8060608 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1407012155000 dot 2640 at laptop-mg dot saclay dot inria dot fr> <53B32D3A dot 1030700 at mentor dot com> <alpine dot DEB dot 2 dot 10 dot 1407020800530 dot 2059 at laptop-mg dot saclay dot inria dot fr> <53B42ACF dot 4080301 at redhat dot com>
[ 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