On Wed, Jan 13, 2016 at 06:39:29PM +0100, Martin Jambor wrote: > --- a/gcc/tree-inline.c > +++ b/gcc/tree-inline.c > @@ -340,8 +340,22 @@ remap_decl (tree decl, copy_body_data *id) > return decl; > } > > - /* If we didn't already have an equivalent for this declaration, > - create one now. */ > + /* When remapping a type within copy_gimple_seq_and_replace_locals, all > + necessary DECLs have already been remapped and we do not want to > duplicate > + a decl coming from outside of the sequence we are copying. */ > + if (!n > + && id->prevent_decl_creation_for_types > + && id->remapping_type_depth > 0 > + && (VAR_P (decl) || TREE_CODE (decl) == PARM_DECL)) > + { > + if (id->do_not_unshare) > + return decl; > + else > + return unshare_expr (decl); > + }
Just return decl; instead of the { if () return decl; else unshare_expr (decl); } - both VAR_DECL and PARM_DECL are tcc_declaration for which unshare_expr doesn't do anything. Otherwise LGTM. I'll get to your other patches tomorrow. Jakub