This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] Teach genrecog/genoutput that scratch registers require write constraint modifiers
- From: Jeff Law <law at redhat dot com>
- To: James Greenhalgh <james dot greenhalgh at arm dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 18 Sep 2014 14:45:59 -0600
- Subject: Re: [Patch] Teach genrecog/genoutput that scratch registers require write constraint modifiers
- Authentication-results: sourceware.org; auth=none
- References: <1411035561-17445-1-git-send-email-james dot greenhalgh at arm dot com>
On 09/18/14 04:19, James Greenhalgh wrote:
Hi,
As discussed in https://gcc.gnu.org/ml/gcc-patches/2014-09/msg01334.html
The construct
(clobber (match_scratch 0 "r"))
is invalid - operand 0 must be marked either write or read/write.
Likewise
(match_* 0 "&r")
is invalid, marking an operand earlyclobber does not remove the need to
also mark it write or read/write.
This patch adds checking for these two error conditions to the generator
programs and documents the restriction.
Bootstrapped on x86, ARM and AArch64 with no new issues.
Ok?
Thanks,
James
---
2014-09-17 James Greenhalgh <james.greenhalgh@arm.com>
* doc/md.texi (Modifiers): Consistently use "read/write"
nomenclature rather than "input/output".
* genrecog.c (constraints_supported_in_insn_p): New.
(validate_pattern): If needed, also check constraints on
MATCH_SCRATCH operands.
* genoutput.c (validate_insn_alternatives): Catch earlyclobber
operands with no '=' or '+' modifier.
+ if (c == '=' || c == '+')
+ seen_inout = true;
Isn't "seen_input" poorly named here? ISTM what we're checking for is
if we've seen an operand that will be written to.
Doesn't it make sense to use read/write nomenclature in the comments and
variable names too?
So with those nits fixed, this patch is OK.
Jeff