This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR35006, avoid putting decls referenced only in types into referenced_vars
- From: "Diego Novillo" <dnovillo at google dot com>
- To: "Richard Guenther" <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org, "Jan Hubicka" <jh at suse dot cz>
- Date: Tue, 29 Jan 2008 10:42:10 -0500
- Subject: Re: [PATCH] Fix PR35006, avoid putting decls referenced only in types into referenced_vars
- References: <Pine.LNX.4.64.0801291445370.7704@zhemvz.fhfr.qr>
On Jan 29, 2008 8:50 AM, Richard Guenther <rguenther@suse.de> wrote:
> PR middle-end/35006
> * tree-inline.h (struct copy_body_data): Add remapping_type_depth
> field.
> * tree-inline.c (remap_type): Increment remapping_type_depth
> around remapping types.
> (copy_body_r): Only add referenced variables if they are referenced
> from code, not types.
Makes sense to me. The rationale here being that if the variable is
only referenced in a type we don't need to have in REFERENCED_VARS.
Now, what happens if a symbol is *only* referenced in a type? Won't
we get rid of it? I guess we won't, as we don't even process it.
One minor grammar nit (not yours, but I just now noticed it):
> /* Global variables we didn't seen yet needs to go into referenced
s/didn't/haven't/
> ! vars. If not referenced from types only. */
> ! if (gimple_in_ssa_p (cfun) && TREE_CODE (*tp) == VAR_DECL
> ! && id->remapping_type_depth == 0)
> add_referenced_var (*tp);
Diego.