This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR35006, avoid putting decls referenced only in types into referenced_vars


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]