This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Avoid duplicate decls in inlined and versioned functions
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, rguenther at suse dot de
- Date: Wed, 4 Mar 2009 07:18:13 -0800
- Subject: Re: Avoid duplicate decls in inlined and versioned functions
- References: <20090228191058.GD13301@kam.mff.cuni.cz>
On Sat, Feb 28, 2009 at 11:10 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> Currently inliner merge callee's local_decls into callers duplicating all
> global vars. ?This can be easilly abused to construct memory bomb using early
> inliner.
>
> Patch adds referenced_var_check_and_insert check into local_decls copying
> code. Now we need to reorder copying before body duplication because we
> add into referenced vars all the variables while copying the VAR_DECLs.
>
> Similar problem exists in function versioning code where declaration of removed
> parameter is added twice: once by copy_arguments_for_versioning, second time by
> setup_one_parameter. ?We need to reorder copying and argument setup and watch
> for existing decls during copying, otherwise we would miss completely
> elliminated declarations. ?Those remain in debug info and confuse GDB
> that is not expecting two declarations with same name in same scope
> block.
>
> Bootstrapped/regtested i686-linux, OK?
>
> ? ? ? ?* tree-inline.c (expand_call_inline): Avoid
I think it caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39360
H.J.