On Mon, Aug 4, 2014 at 4:13 PM, Prathamesh Kulkarni
<bilbotheelffri...@gmail.com> wrote:
> Added patterns in associate_pointerplus and associate_pointerplus_diff.
>
> * genmatch.c (capture_max): Change value to 6.
>       (match-plusminus.pd): Add new patterns.
>
> [gcc/testsuite/gcc.dg/tree-ssa]
>   * match-plusminus.c (plusminus_9): New test-case.

Any reason you match a conversion for associate_pointerplus?

associate_pointerplus_diff misses to match that ptr1 == ptr1.  I suggest
to write it as

/* associate_pointerplus_diff: ptr1 p+ (ptr2 - ptr1) -> ptr2 */
(match_and_simplify
  (pointer_plus @0
               (convert (minus (convert @1)
                                      (convert @0))))

I have applied the patch with the two parts fixed.

Thanks,
Richard.

>
> Thanks,
> Prathamesh

Reply via email to