[PATCH] Fix PR tree-optimization/32589

Richard Guenther richard.guenther@gmail.com
Tue Jul 10 13:54:00 GMT 2007


On 7/10/07, Eric Botcazou <ebotcazou@adacore.com> wrote:
> > > Or FRE should do what other passes do and use set_rhs () to verify if the
> > > resulting trees are sufficiently gimple
> >
> > Indeed, looks like Tree-CCP already faced the problem and solved it.  I'm
> > going to try something along these lines.
>
> I can propose this, very lightly tested.

I like this a lot better though would suggest valid_gimple_rhs_p for the name
(or is_valid_gimple_rhs).  Also in simplify_binary_expression PRE tries to
select "useful" results, so the check for valid_gimple_rhs_p should be
probably in addition to the existing ones, like

  if (result && valid_gimple_rhs_p (result))
    {
       if (is_gimple_min_invariant (result))
         ....

Richard.

>         * tree-ssa-propagate.c (is_valid_gimple_rhs_after_folding): New
>         predicate, extracted from...
>         (set_rhs): ...here.  Call it on the expression.
>         * tree-ssa-propagate.h (is_valid_gimple_rhs_after_folding): Declare.
>         * tree-ssa-sccvn.c: Include tree-ssa-propagate.h.
>         (simplify_binary_expression): Use is_valid_gimple_rhs_after_folding
>         to validate the simplification.
>         * Makefile.in (tree-ssa-sccvn.o): Depends on tree-ssa-propagate.h.
>
>
> --
> Eric Botcazou
>
>



More information about the Gcc-patches mailing list