[tree-ssa] GGC friendly function save/restore
Jan Hubicka
jh@suse.cz
Fri Nov 28 23:19:00 GMT 2003
> On Fri, Nov 28, 2003 at 11:18:16PM +0100, Jan Hubicka wrote:
> > /* Nonzero if the rtl inliner has saved the function for inlining. */
> > unsigned int saved_for_inline : 1;
> > +
> > + /* Saved tree and arguments during tree optimization. Used later for
> > + inlining */
> > + tree GTY(()) saved_tree;
> > + tree GTY(()) saved_args;
>
> Not ok.
>
> (1) No need for GTY markings on individual fields.
> (2) You didn't put these at the correct place. Read the comments.
I see.
>
> > + if (cfun->saved_tree)
> > + {
> > + /* We might need the body of this function so that we can expand
> > + it inline somewhere else. */
> > + DECL_SAVED_TREE (fndecl) = cfun->saved_tree;
> > + DECL_ARGUMENTS (fndecl) = cfun->saved_args;
> > + }
> > + cfun = 0;
>
> (3) What do you think this is doing?
> cfun == DECL_SAVED_INSNS (current_function_decl), so this is still
> reachable. You definitely beed to zap saved_tree/saved_args here.
> Which also means that the zapping of saved_tree earlier should have
> been useless.
DECL_SAVED_INSNS is zapped at the end of rest_of_compilation. Perhaps I
should move that bit to line just bellow cfun = 0 to make this more
readable. Or am I missing your point?
>
> (4) I also don't see that you've replaced the ggc_collect call that
> you removed. The intent is to get rid of all the rtl that is now
> most definitely garbage.
>
This got lost during patch separation, sorry. I have many ggc_collect
calls in tree-optimize now and I killed them all. I will re-add one
just after cfun = 0.
Honza
>
> r~
More information about the Gcc-patches
mailing list