This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] live analysis on local static functions
- From: Jan Hubicka <jh at suse dot cz>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: law at redhat dot com, Jan Hubicka <jh at suse dot cz>,Andrew MacLeod <amacleod at redhat dot com>,gcc mailing list <gcc at gcc dot gnu dot org>,Diego Novillo <dnovillo at redhat dot com>,Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 15 Oct 2003 23:34:19 +0200
- Subject: Re: [tree-ssa] live analysis on local static functions
- References: <20031014180700.GO6212@kam.mff.cuni.cz> <200310151806.h9FI6QME027848@speedy.slc.redhat.com> <20031015203202.GD7266@atrey.karlin.mff.cuni.cz>
> > In message <20031014180700.GO6212@kam.mff.cuni.cz>, Jan Hubicka writes:
> > >> Once my current cleanups are done testing I'll poke at this and post a patc
> > >h.
> > >
> > >OK, thanks!
> > >BTW with the patch to avoid removal and -funit-at-a-time on by default,
> > >I can get into stage3 but then I get abort in finish_spills :(
> > Based on Richard's message, I'm holding off for the moment. There's a
> > deeper issue and if I hack this into the useless variable remover we're
> > just going to be papering over that issue.
> >
> > Can you check your test into the testsuite on the branch? That'll help
> > make sure it doesn't get lost :-)
>
> OK, I will try to figure out who and why is producing the cloned
> variable and in case I will fail I will commit the testcase alone.
> The other misscompilation of GCC seems to be related to aggressive
> inlining too. Hope it is related issue as last thing I want to dig into
> is missoptimization of reload.
Hi,
The problem is that when duplicating body, we ignore VAR_DECL for static
functions, while when duplicating body of BIND_EXPR we duplicate all var
decls. OK for mainline and tree-ssa assuming testing passes on both?
(it solves my testcase, I am now bootstrapping both trees in
unit-at-a-time mode wishing to have good luck this time)
Honza
Wed Oct 15 23:30:28 CEST 2003 Jan Hubicka <jh@suse.cz>
* tree-inline.c (remap_decls): Do not remap static decls.
*** ../gcc.old/tree-inline.c Sat Oct 11 20:39:42 2003
--- tree-inline.c Wed Oct 15 23:29:24 2003
*************** remap_decls (tree decls, inline_data *id
*** 324,329 ****
--- 324,330 ----
{
tree old_var;
tree new_decls = NULL_TREE;
+ tree fn = VARRAY_TOP_TREE (id->fns);
/* Remap its variables. */
for (old_var = decls; old_var; old_var = TREE_CHAIN (old_var))
*************** remap_decls (tree decls, inline_data *id
*** 331,337 ****
tree new_var;
/* Remap the variable. */
! new_var = remap_decl (old_var, id);
/* If we didn't remap this variable, so we can't mess with its
TREE_CHAIN. If we remapped this variable to the return slot, it's
--- 332,341 ----
tree new_var;
/* Remap the variable. */
! if ((*lang_hooks.tree_inlining.auto_var_in_fn_p) (old_var, fn))
! new_var = remap_decl (old_var, id);
! else
! new_var = old_var;
/* If we didn't remap this variable, so we can't mess with its
TREE_CHAIN. If we remapped this variable to the return slot, it's