[match-and-simplify] reject conditional convert and commutative ops in result operand

Prathamesh Kulkarni bilbotheelffriend@gmail.com
Tue Oct 28 12:27:00 GMT 2014


On Tue, Oct 28, 2014 at 3:50 PM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Mon, Oct 27, 2014 at 3:32 PM, Prathamesh Kulkarni
> <bilbotheelffriend@gmail.com> wrote:
>> I suppose we should reject conditional convert and commutative ops in
>> result operand ? since it would create 1-n mapping from match ->
>> result.
>
> Yeah.  Same is true for parsing of :type syntax for the match part.
> Now that we have a class parser I think it would be better to simply
> record whether we are parsing ->match or ->result and issue the
> diagnostic at parsing time.
>
> Can you adjust the patch accordingly?
Is the following version okay ?

* genmatch.c
  (parser): Add new member parsing_match_operand.
  (parser::parse_operation): Check for conditional convert in result operand.
  (parser::parse_expr): Check for commutative operator in result operand.
                                     Check for :type in match operand.
  (parser::parse_simplify): Set/unset parsing_match_operand.

Thanks,
Prathamesh

>
> Thanks,
> Richard.
>
>> * genmatch.c
>>   (fatal_at): New overloaded function with source_location as first parameter.
>>   (has_opt_convert_or_commutative_ops): New function.
>>   (lower): Call has_opt_convert_or_commutative_ops.
>>
>> Thanks,
>> Prathamesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v2.patch
Type: text/x-patch
Size: 1715 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20141028/fc883369/attachment.bin>


More information about the Gcc-patches mailing list