This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [genmatch] reject duplicate captures used as arguments in user-defined predicates
- From: Richard Biener <rguenther at suse dot de>
- To: Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>
- Cc: gcc Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 29 Mar 2016 10:48:25 +0200 (CEST)
- Subject: Re: [genmatch] reject duplicate captures used as arguments in user-defined predicates
- Authentication-results: sourceware.org; auth=none
- References: <CAAgBjMmFRSAmv5Povi=ysGyUFbx8-=iqMc8zbZNQT_DXb_37EA at mail dot gmail dot com>
On Tue, 29 Mar 2016, Prathamesh Kulkarni wrote:
> Hi,
> I suppose we should reject duplicate captures used as "arguments" in user
> defined predicates ?
> eg:
> (match (foo @0 @0)
> match-template)
> The attached patch prints error "duplicate capture id" for above pattern.
> Bootstrapped+tested on x86_64-pc-linux-gnu.
> Ok for trunk ?
Using a duplicate probably doesn't make sense but it works just fine.
You get res_args[0] == res_args[1] == @0 in the above case.
Richard.