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 atrey dot karlin dot mff dot cuni dot cz>
- Cc: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 13 Aug 2003 14:01:48 -0400
- Subject: Re: [tree-ssa] Fix variables getting out of their scope
- Organization: Red Hat Canada
- References: <20030810203732.GA27897@kam.mff.cuni.cz> <1060773437.3156.48.camel@frodo.toronto.redhat.com> <20030813171453.GA5856@atrey.karlin.mff.cuni.cz>
On Wed, 2003-08-13 at 13:14, 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.
>
> I am not quite sure what you refer to here? Neither stmt_ann_d nor
> bb_ann_d contain anything that seems related.
>
Sorry, I wasn't very clear. What I mean is that instead of creating a
new struct block_tree, we could just record the BLOCK where each
statement belongs.
When you start building the basic blocks for the function, you start
pointing all statements to DECL_INITIAL (fndecl). Then every time you
find a BIND_EXPR statement, you set the current block to be
BIND_EXPR_BLOCK(stmt) so that statements inside that BIND_EXPR get
associated with the new block.
In stmt_ann_d and bb_ann_d you just need a 'tree' field to record the
block where the statement/block belongs to.
> But since the scope is not set for newly created variables (and I did
> not want to try finding all places where it occurs), I use the fact
> that they don't have it set as indication
>
Oh, OK.
I'll let Jason comment on the DECL_ABSTRACT_ORIGIN problem. I don't
really know what the problem is.
Diego.