[PATCH] Fix PR32586, restore combining of conversions in SCCVN

Daniel Berlin dberlin@dberlin.org
Thu Sep 6 15:00:00 GMT 2007


On 9/6/07, Richard Guenther <rguenther@suse.de> wrote:
> On Thu, 6 Sep 2007, Daniel Berlin wrote:
>
> > On 9/6/07, Richard Guenther <rguenther@suse.de> wrote:
> > >
> > > This fixes PR32586 (as I promised to do) and re-instantiates
> > > tree-combining of conversions in FRE/SCCVN.  This allows to remove
> > > a bunch of XFAILs Danny added at SCCVN merge time.  This also fixes
> > > the builtins-51.c failure on trunk.
> > >
> > > Bootstrapped and tested on x86_64-unknown-linux-gnu.  Danny, are
> > > the SCCVN changes ok?  (Is there a better way than value_expr_p?
> > > What I would need is a predicate that tells whether I can substitute
> > > VN_INFO -> expr for the value number in expressions)
> >
> > has_constants can normally tell you whether you can substitute the
> > ->expr in, but that was predicated on the idea that we only wanted to
> > substitute in constants.
> >
> > If this is no longer true, i'm okay with value_expr_p for now.
>
> That's not true in the case I try to solve.  I want us to substitute in
>
>  unsigned int b_2;
>  a_1 = (int) b_2;
>  c_2 = (unsigned int) a_1;
>
> so we can value-number c_2 as b_2.  Obviously a_1 doesn't have constants.
>
> I see has_constants is set from expr_has_constants, but this doesn't
> check if for binary expressions the operands do not do loads.  Ah, wait -
> if for all exprs we can assume they are gimple then I only need to
> check for bare ssa names or constants as both tcc_unary and tcc_binary
> operands cannot do loads.
>
> I'll change along this way and commit it if it works out.

Works for me :)

>
> Thx,
> Richard.
>



More information about the Gcc-patches mailing list