This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] RFC: Making control flow more explicit
Hello,
> > as far as I understand the code, this should fix the problem.
>
> No, this won't, because it won't walk the statics and their initializers.
>
> Like given:
> {
> void (*func_ptr) () * __DTOR_LIST__.107;
> long int T.108;
> long int T.109;
> static void (*func_ptr) () * p = &__DTOR_LIST__ + 4B;
>
> We'll miss the assignment to p.
>
> This is originally why i used walk_tree_without_duplicates in the first
> place.
ok, second attempt.
Index: tree-alias-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-alias-common.c,v
retrieving revision 1.1.2.33
diff -c -3 -p -r1.1.2.33 tree-alias-common.c
*** tree-alias-common.c 29 Jul 2003 15:19:49 -0000 1.1.2.33
--- tree-alias-common.c 10 Aug 2003 08:43:45 -0000
*************** create_alias_vars (tree fndecl)
*** 935,941 ****
--- 935,945 ----
tree fnbody;
#endif
size_t i;
+ basic_block bb;
+ block_stmt_iterator bsi;
+ struct block_tree *block;
currptadecl = fndecl;
+
if (!global_var)
{
create_global_var ();
*************** create_alias_vars (tree fndecl)
*** 970,981 ****
DECL_PTA_TYPEVAR (fndecl) = NULL;
get_alias_var (fndecl);
! /* For debugging, disable the on-the-fly variable creation,
! and reenable this. */
! /* walk_tree_without_duplicates (&DECL_SAVED_TREE (fndecl),
! find_func_decls, NULL);*/
! walk_tree_without_duplicates (&DECL_SAVED_TREE (fndecl),
! find_func_aliases, NULL);
if (we_created_global_var)
global_var = NULL_TREE;
--- 974,992 ----
DECL_PTA_TYPEVAR (fndecl) = NULL;
get_alias_var (fndecl);
! FOR_EACH_BB (bb)
! {
! for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
! {
! walk_tree_without_duplicates (bsi_stmt_ptr (bsi),
! find_func_aliases, NULL);
! }
! }
! for (block = bti_start (); !bti_end_p (block); bti_next (&block))
! if (block->type == BT_BIND)
! walk_tree_without_duplicates (&BIND_EXPR_VARS (block->bind),
! find_func_aliases, NULL);
!
if (we_created_global_var)
global_var = NULL_TREE;
Index: tree-flow.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-flow.h,v
retrieving revision 1.1.4.101
diff -c -3 -p -r1.1.4.101 tree-flow.h
*** tree-flow.h 8 Aug 2003 00:27:10 -0000 1.1.4.101
--- tree-flow.h 10 Aug 2003 08:43:45 -0000
*************** struct bb_ann_d
*** 289,293 ****
static inline bitmap dom_children (basic_block);
/*---------------------------------------------------------------------------
Iterators for statements inside a basic block
--- 333,341 ----
static inline bitmap dom_children (basic_block);
+ /* Iterator for traversing block tree. */
+ static inline struct block_tree *bti_start (void);
+ static inline bool bti_end_p (struct block_tree *);
+ static inline void bti_next (struct block_tree **);
/*---------------------------------------------------------------------------
Iterators for statements inside a basic block
Index: tree-flow-inline.h
===================================================================
*** tree-flow-inline.h 2003-08-10 06:49:05.000000000 -0400
--- tree-flow-inline.h 2003-08-10 06:07:29.000000000 -0400
*************** dom_children (basic_block bb)
*** 328,333 ****
--- 328,362 ----
/* ----------------------------------------------------------------------- */
+ static inline struct block_tree *
+ bti_start ()
+ {
+ return block_tree;
+ }
+
+ static inline bool
+ bti_end_p (struct block_tree *block)
+ {
+ return !block;
+ }
+
+ static inline void
+ bti_next (struct block_tree **block)
+ {
+ struct block_tree *act = *block;
+
+ if (act->subtree)
+ {
+ *block = act->subtree;
+ return;
+ }
+
+ while (act->outer && !act->next)
+ act = act->outer;
+
+ *block = act->next;
+ }
+
static inline bool
bsi_end_p (block_stmt_iterator i)
{
Zdenek