This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] Fix variables getting out of their scope


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]