diff -Naur gcc-4.5.0/gcc/common.opt gcc-4.5.0/gcc/common.opt --- gcc-4.5.0/gcc/common.opt 2010-03-18 08:31:09.000000000 +0530 +++ gcc-4.5.0/gcc/common.opt 2010-07-02 17:43:50.451668665 +0530 @@ -697,6 +697,10 @@ Common Report Var(flag_ipa_pta) Init(0) Optimization Perform interprocedural points-to analysis +fipa-gm +Common Report Var(flag_ipa_gimple_manipulation) Init(0) Optimization +Enable pass named pass_gimple_manipulation + fipa-reference Common Report Var(flag_ipa_reference) Init(0) Optimization Discover readonly and non addressable static variables diff -Naur gcc-4.5.0/gcc/gimple-manipulation.c gcc-4.5.0/gcc/gimple-manipulation.c --- gcc-4.5.0/gcc/gimple-manipulation.c 1970-01-01 05:30:00.000000000 +0530 +++ gcc-4.5.0/gcc/gimple-manipulation.c 2010-07-02 17:49:58.864244908 +0530 @@ -0,0 +1,56 @@ +/*--------------------------------------------------------------------- + A pass for gimple manipulation for GCC Workshop 2010. +-----------------------------------------------------------------------*/ +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "tm_p.h" +#include "diagnostic.h" +#include "tree-flow.h" +#include "tree-pass.h" +#include "toplev.h" + +static unsigned int execute_gimple_manipulation (void); +static bool gate_gimple_manipulation (void); + +/*------------------------- + The main driver function. + -------------------------*/ +static unsigned int +execute_gimple_manipulation (void) +{ + if (dump_file) + fprintf (dump_file, "This is a dummy pass.\n"); + return 0; +} + +/* ------------------------------------------ + Return true if we should execute our pass. + ------------------------------------------*/ +static bool +gate_gimple_manipulation (void) +{ + return (flag_unit_at_a_time != 0 && flag_ipa_gimple_manipulation + /* Don't bother doing anything if the program has errors. */ + && !(errorcount || sorrycount)); +} + +struct simple_ipa_opt_pass pass_gimple_manipulation = +{ + { + SIMPLE_IPA_PASS, + "gm", /* name */ + gate_gimple_manipulation, /* gate */ + execute_gimple_manipulation, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static pass number */ + 0, /* tv_id */ + 0, /* properties required */ + 0, /* properties provided */ + 0, /* properties destroyed */ + 0, /* todo_flags start */ + 0 /* todo_flags end */ + } +}; diff -Naur gcc-4.5.0/gcc/Makefile.in gcc-4.5.0/gcc/Makefile.in --- gcc-4.5.0/gcc/Makefile.in 2010-04-02 13:19:06.000000000 +0530 +++ gcc-4.5.0/gcc/Makefile.in 2010-07-02 17:43:50.455657720 +0530 @@ -1206,6 +1206,7 @@ gimple.o \ gimple-iterator.o \ gimple-low.o \ + gimple-manipulation.o \ gimple-pretty-print.o \ gimplify.o \ graph.o \ @@ -2285,6 +2286,8 @@ $(GIMPLE_H) $(HASHTAB_H) $(FUNCTION_H) $(CGRAPH_H) \ $(TREE_PASS_H) $(TIMEVAR_H) alloc-pool.h $(SPLAY_TREE_H) $(PARAMS_H) \ gt-tree-ssa-structalias.h $(CGRAPH_H) $(ALIAS_H) pointer-set.h +gimple-manipulation.o : gimple-manipulation.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) $(BASIC_BLOCK_H) $(DF_H) $(OBSTACK_H) $(TIMEVAR_H) tree-pass.h tree-ssa.o : tree-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h $(DIAGNOSTIC_H) \ $(TOPLEV_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ diff -Naur gcc-4.5.0/gcc/passes.c gcc-4.5.0/gcc/passes.c --- gcc-4.5.0/gcc/passes.c 2010-04-03 01:24:46.000000000 +0530 +++ gcc-4.5.0/gcc/passes.c 2010-07-02 17:43:50.507681021 +0530 @@ -803,6 +803,8 @@ p = &all_regular_ipa_passes; NEXT_PASS (pass_ipa_whole_program_visibility); + /* Invoke Gimple Analysis Pass */ + NEXT_PASS (pass_gimple_manipulation); NEXT_PASS (pass_ipa_cp); NEXT_PASS (pass_ipa_inline); NEXT_PASS (pass_ipa_reference); diff -Naur gcc-4.5.0/gcc/tree-pass.h gcc-4.5.0/gcc/tree-pass.h --- gcc-4.5.0/gcc/tree-pass.h 2010-04-03 01:24:46.000000000 +0530 +++ gcc-4.5.0/gcc/tree-pass.h 2010-07-02 17:43:50.524594064 +0530 @@ -454,6 +454,9 @@ extern struct simple_ipa_opt_pass pass_ipa_struct_reorg; extern struct ipa_opt_pass_d pass_ipa_lto_wpa_fixup; extern struct ipa_opt_pass_d pass_ipa_lto_finish_out; +/* Register the gimple analysis pass */ +extern struct simple_ipa_opt_pass pass_gimple_manipulation; + extern struct gimple_opt_pass pass_all_optimizations; extern struct gimple_opt_pass pass_cleanup_cfg_post_optimizing; diff -Naur gcc-4.5.0/Makefile.in gcc-4.5.0/Makefile.in --- gcc-4.5.0/Makefile.in 2010-02-17 16:31:44.000000000 +0530 +++ gcc-4.5.0/Makefile.in 2010-07-02 17:43:50.608650479 +0530 @@ -942,6 +942,11 @@ maybe-configure-target-libada \ maybe-configure-target-libgomp +# The target build for cc1 +.PHONY: cc1 +cc1: + make all-gcc TARGET-gcc=cc1$(exeext) + # The target built for a native non-bootstrap build. .PHONY: all all: