This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ patch] one more missed mark_used
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 02 Aug 2003 13:24:05 -0700
- Subject: Re: [C++ patch] one more missed mark_used
- References: <20030730173156.GZ24216@kam.mff.cuni.cz><1059694982.17539.56.camel@doubledemon.codesourcery.com> <20030802113645.GB8233@kam.mff.cuni.cz>
> static tree
> ! mark_member_pointers (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
> ! void *data ATTRIBUTE_UNUSED)
> {
> if (TREE_CODE (*tp) == PTRMEM_CST
> && TYPE_PTRMEMFUNC_P (TREE_TYPE (*tp)))
> cgraph_mark_needed_node (cgraph_node (PTRMEM_CST_MEMBER (*tp)), 1);
> return 0;
> }
>
> --- 2561,2588 ----
> /* Callgraph code does not understand the member pointers. Mark the methods
> referenced as used. */
> static tree
> ! mark_member_pointers_and_eh_handlers (tree *tp,
> ! int *walk_subtrees,
> ! void *data ATTRIBUTE_UNUSED)
> {
> + /* Avoid useless walking of complex type and declaration nodes. */
> + if (TYPE_P (*tp) || DECL_P (*tp))
You should be careful about this test. For example, I expect that you
will now not walk the initializers of declarations, which might contain
pointers-to-members, or statement-expressions containing try/catch
blocks.
This code:
+ if (type)
+ {
+ tree tinfo = get_tinfo_decl (type);
+ mark_used (tinfo);
+ }
will penalize not-function-at-a-time mode compilation because it will
result in generating additional typeinfos, even when the back end
optimizes away the handlers.
So, this is not OK.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com