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]

[tree-ssa branch] double-chain statements


We're going to need double-chained statements to do anything really
interested in the tree optimizers.  This patch enables building and
tearing down the backpointers in the statement chain.

Installed onto the tree-ssa branch.

	* Makefile.in (tree-optimize.o): Depend on tree-dchain.o
	* tree-optimize.c: Include tree-dchain.h.
	(optimize_function_tree): Unconditionally build and tear down
	the backpointers for the statement chain.
	
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.903.2.17
diff -c -3 -p -r1.903.2.17 Makefile.in
*** Makefile.in	20 Aug 2002 19:21:40 -0000	1.903.2.17
--- Makefile.in	22 Aug 2002 21:48:56 -0000
*************** tree-dfa.o : tree-dfa.c tree-optimize.h 
*** 1405,1411 ****
     $(GGC_H) output.h diagnostic.h errors.h $(C_TREE_H)
  tree-optimize.o : tree-optimize.c tree-optimize.h tree-flow.h $(CONFIG_H) \
     $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(BASIC_BLOCK_H) $(EXPR_H) \
!    $(GGC_H) output.h diagnostic.h ssa.h errors.h flags.h tree-alias-steen.h
  c-simplify.o : c-simplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) errors.h \
     $(C_TREE_H) $(C_COMMON_H) diagnostic.h tree-simple.h varray.h flags.h \
     langhooks.h toplev.h rtl.h tree-flow.h $(BASIC_BLOCK_H)
--- 1405,1412 ----
     $(GGC_H) output.h diagnostic.h errors.h $(C_TREE_H)
  tree-optimize.o : tree-optimize.c tree-optimize.h tree-flow.h $(CONFIG_H) \
     $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(BASIC_BLOCK_H) $(EXPR_H) \
!    $(GGC_H) output.h diagnostic.h ssa.h errors.h flags.h tree-alias-steen.h \
!    tree-dchain.h
  c-simplify.o : c-simplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) errors.h \
     $(C_TREE_H) $(C_COMMON_H) diagnostic.h tree-simple.h varray.h flags.h \
     langhooks.h toplev.h rtl.h tree-flow.h $(BASIC_BLOCK_H)
Index: tree-optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-optimize.c,v
retrieving revision 1.1.4.5
diff -c -3 -p -r1.1.4.5 tree-optimize.c
*** tree-optimize.c	7 Aug 2002 16:02:58 -0000	1.1.4.5
--- tree-optimize.c	22 Aug 2002 21:48:56 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 34,39 ****
--- 34,40 ----
  #include "tree-optimize.h"
  #include "tree-flow.h"
  #include "tree-alias-steen.h"
+ #include "tree-dchain.h"
  
  /* Local functions.  */
  static void init_tree_flow PARAMS ((void));
*************** optimize_function_tree (fndecl)
*** 49,60 ****
    if (errorcount || sorrycount)
      return;
    
  #if 0
    /* Transform BREAK_STMTs, CONTINUE_STMTs, SWITCH_STMTs and GOTO_STMTs.  */
-   double_chain_stmts (fn);
    break_continue_elimination (fndecl);
    goto_elimination (fndecl);
-   double_chain_free (fn);
  #endif
  
    /* Build the SSA representation for the function.  */
--- 50,63 ----
    if (errorcount || sorrycount)
      return;
    
+   /* Build the doubly-linked lists so that we can delete nodes
+      efficiently.  */
+   double_chain_stmts (DECL_SAVED_TREE (fndecl));
+ 
  #if 0
    /* Transform BREAK_STMTs, CONTINUE_STMTs, SWITCH_STMTs and GOTO_STMTs.  */
    break_continue_elimination (fndecl);
    goto_elimination (fndecl);
  #endif
  
    /* Build the SSA representation for the function.  */
*************** optimize_function_tree (fndecl)
*** 69,74 ****
--- 72,80 ----
        if (flag_tree_ssa_ccp)
  	tree_ssa_ccp (fndecl);
      }
+ 
+   /* Wipe out the back-pointes in the statement chain.  */
+   double_chain_free (DECL_SAVED_TREE (fndecl));
  
    /* Flush out flow graph and SSA data.  */
    delete_cfg ();





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