This is the mail archive of the
mailing list for the GCC project.
Re: [match-and-simplify] error checking on user defined oper in for
- From: Prathamesh Kulkarni <bilbotheelffriend at gmail dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 28 Oct 2014 15:57:25 +0530
- Subject: Re: [match-and-simplify] error checking on user defined oper in for
- Authentication-results: sourceware.org; auth=none
- References: <CAJXstsCABPFqxqYtKUZquR1PptovvOVVhRHZ9y5yGTEQ4rkwBw at mail dot gmail dot com> <CAFiYyc2AxtcTFoSs+TBe+OcBkvDdrj3J134sJsNb+fW-m2W45Q at mail dot gmail dot com>
On Tue, Oct 28, 2014 at 3:45 PM, Richard Biener
> On Sat, Oct 25, 2014 at 8:16 PM, Prathamesh Kulkarni
> <firstname.lastname@example.org> wrote:
>> Currently this is accepted:
>> (for plus (mult div)
>> which is incorrect. This patch puts more error-checks on the user-defined
>> operator in for-pattern.
> Nicely spotted issue. But I prefer to fix it simpler like with the following
> which I applied.
Won't using get_operator() lookup the hash-table twice for a valid
user-defined operator ?
I thought it would be be better instead to write another function
(insert_operator) to insert operator into hash-table, that does one
> 2014-10-28 Richard Biener <email@example.com>
> * genmatch.c (parser::parse_for): Properly check for already
> defined operators.
>> * genmatch.c
>> (insert_operator): New function.
>> (parse_for): Call insert_operator.