This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add un-distribution capabilities to tree reassoc (3rd try)
- From: Richard Guenther <rguenther at suse dot de>
- To: Xinliang David Li <davidxl at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 15 Aug 2008 11:43:37 +0200 (CEST)
- Subject: Re: [PATCH] Add un-distribution capabilities to tree reassoc (3rd try)
- References: <1218123327.30002.ezmlm@gcc.gnu.org> <48A49C8C.9020705@google.com>
On Thu, 14 Aug 2008, Xinliang David Li wrote:
>
> > > > lhs = gimple_assign_lhs (stmt);
> > > > rhs1 = gimple_assign_rhs1 (stmt);
> > > > --- 1760,1775 ----
> > > > /* If this was part of an already processed statement,
> > > > we don't need to touch it again. */
> > > > if (gimple_visited_p (stmt))
> > > > ! {
> > > > ! /* This statement might have become dead because of
> > > > previous
> > > > ! reassociations. */
> > > > ! if (has_zero_uses (gimple_get_lhs (stmt)))
> > > > ! {
> > > > ! gsi_remove (&gsi, true);
> > > > ! release_defs (stmt);
>
> There seem to be a minor problem -- there needs to be an gsi_end_p check and
> break after the removal.
Just by visual inspection or do you have a testcase? As we are walking
from the end of the basic-block to the beginning we shouldn't hit the
last statement again (note this is guarded by gimple_visited_p).
Richard.