This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Fix variables getting out of their scope
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 13 Aug 2003 07:53:06 -0400
- Subject: Re: [tree-ssa] Fix variables getting out of their scope
- Organization: Red Hat Canada
- References: <20030810203732.GA27897@kam.mff.cuni.cz>
On Sun, 2003-08-10 at 16:37, Zdenek Dvorak wrote:
> Changelog:
> * tree-flow.h (struct block_tree): New.
> (block_tree): Declare.
>
Why is this necessary? Why not use the existing BLOCK_* macros? As we
build the CFG we annotate statements with the BLOCK that contains them.
Otherwise, you're duplicating functionality.
The block depth number can be initialized in a similar way as it's done
for the RTL flowgraph in set_block_levels.
> *************** propagate_copy (tree *op_p, tree var)
> *** 225,228 ****
> --- 230,271 ----
> }
>
> *op_p = var;
> +
> + old_scope = var_ann (SSA_NAME_VAR (var))->scope;
> + if (old_scope)
>
old_scope should always exist. We don't copy propagate globals.
> + /* Moves variable VAR from OLD_SCOPE to SCOPE. */
> + static void
> + move_var_to_scope (tree var, struct block_tree *old_scope,
> + struct block_tree *scope)
> + {
> + tree *ch;
> +
> + for (ch = &BIND_EXPR_VARS (old_scope->bind); *ch; ch = &TREE_CHAIN (*ch))
> + if (*ch == var)
> + break;
> + if (!*ch)
> + abort ();
> + *ch = TREE_CHAIN (*ch);
> +
> + TREE_CHAIN (var) = BIND_EXPR_VARS (scope->bind);
> + BIND_EXPR_VARS (scope->bind) = var;
> + var_ann (var)->scope = scope;
> +
> + /* ??? Not sure why, but it makes dwarf2out happy. */
> + DECL_ABSTRACT_ORIGIN (var) = NULL_TREE;
>
Could you find out? What happens if DECL_ABSTRACT_ORIGIN(var) was not
NULL to begin with?
Diego.