This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] dead const/pure/alloca call removal
> > On Sat, 08 Nov 2003 10:55:16 -0800, "Zack Weinberg" <zack@codesourcery.com> wrote:
> >
> > > Falk Hueffner <falk.hueffner@student.uni-tuebingen.de> writes:
> > >
> > >> Jan Hubicka <jh@suse.cz> writes:
> > >>
> > >>> + /* Return false when CALL can be removed when it's return value is dead.
> > >> ^ true?
> > >>
> > >> I would formulate it like this:
> > >>
> > >> Return true if CALL can be removed in case its return value is dead.
> > >
> > > Still better English, given your explanation of the return value:
> > >
> > > Return true if CALL cannot be removed even if its return value
> > > is dead (i.e. CALL must be assumed to have side effects).
> >
> > We have a flag for this: TREE_SIDE_EFFECTS, which is cleared in
> > gimplify_call_expr for const functions. If it should also be cleared for
> > pure and alloca calls, please make the change there rather than introduce a
> > new function.
>
> OK, I will update the pure functions and ask for TREE_SIDE_EFFECTS.
> Are you really sure we want to clear alloca too? It has side effect.
> Only I know that given the semantic of alloca the side effect is useless
> when return value is thrown away.
This has a problem. We first gimplify functions, then analyze them and
mark as CONST/PURE and then optimize. So we lose the information.
Wehre do you think this flag should be updated?
(remove_useless* looks like one candidate)
Honza
>
> Honza
> >
> > Jason