diff -Naur gcc-4.3.0/gcc/basic-block.h gcc-4.3.0/gcc/basic-block.h
--- gcc-4.3.0/gcc/basic-block.h	2010-03-21 22:52:49.760223858 +0530
+++ gcc-4.3.0/gcc/basic-block.h	2010-03-21 22:46:50.184032964 +0530
@@ -241,11 +241,8 @@
   /* The index of this block.  */
   int index;
 
-  /*----------- Start: Seema -------------*/
   /* The dfs_numbering of a basic block*/
   signed int dfs_number;
-  /*----------- End: Seema -------------*/
-
 
   /* The loop depth of this block.  */
   int loop_depth;
diff -Naur gcc-4.3.0/gcc/ChangeLog.grc gcc-4.3.0/gcc/ChangeLog.grc
--- gcc-4.3.0/gcc/ChangeLog.grc	1970-01-01 05:30:00.000000000 +0530
+++ gcc-4.3.0/gcc/ChangeLog.grc	2010-03-21 22:46:50.184032964 +0530
@@ -0,0 +1,72 @@
+2008-06-08 Seema Ravandale <seema@cse.iitb.ac.in>
+	
+	* gcc/gimple-pfbvdfa-support.c: (init_gimple_pfbvdfa_execute) 
+	Now make number_of_nodes equal to n_basic_blocks as entry and exit 
+	block indices start from 0 and 1.
+	(find_index_bb) No more separate handling for entry and exit block
+	index.
+	(assign_indices_to_local_expr) While checking for first operand to be 
+	interger_cnt, op0_index  should be made -1.
+	* gcc/tree-cfg.c: (init_empty_tree_cfg) Initialize dfs_number to
+	-1.
+
+2008-02-25 Seema Ravandale <seema@cse.iitb.ac.in>
+	
+	* gcc/gimple-pfbvdfa-support.c: (type_of_var) Default return 
+	uninteresting_var_type.
+	(is_global_var_grc) New function to test for a global variable.
+	(assign_indices_to_var) Handle case of uninteresting
+	var type.
+	(assign_indices_to_defn) Handle case of uninteresting 
+	defn_type.
+	
+2008-11-28 Seema Ravandale <seema@cse.iitb.ac.in>
+
+	* gcc/gimple-pfbvdfa-driver.c: (effect_of_a_statement) accumulate 
+	effect of a statement for entity definition.
+	(defn_in_statement) New function to compute gen, kill of a
+	definition occured in a statement.
+	
+2008-11-25 Seema Ravandale <seema@cse.iitb.ac.in>
+		
+	Specifications and supportive functions for Reaching definition 
+	analysis.
+	
+	* gcc/gimple-pfbvdfa-specs.c: (struct gimple_pfbv_dfa_spec gdfa_rd)
+	Specification for reaching definition analysis.
+	(struct tree_opt_pass pass_gimple_pfbv_rd_dfa) New pass.
+	(gimple_pfbv_rd_dfa) Function to call for above pass.
+	* gcc/gimple-pfbvdfa.h: (struct defn_index_list) Data structure to 
+	store definition numbers in linked-list.
+	* gcc/gimple-pfbvdfa-support.c: (assign-indices_to_defn, type_of_defn,
+	is_valid_defn) Accessor functions to assign indices to definitions 
+	which are under consideration for gdfa.
+	(defn_of_vars) Data sturecture to store definitions of a variable.
+	* gcc/passes.c: Add new pass pass_gimple_pfbv_rd_dfa.
+	* gcc/tree-pass.h: Extern definition of pass_gimple_pfbv_rd_dfa.
+	
+2008-09-11 Uday Khedker <uday@cse.iitb.ac.in>
+
+	Generic Bit Vector Data Flow Analyzer for Gimple IR with
+        example instantiations for several bit vector frameworks	
+	
+	* gcc/Makefile.in: Add target for gimple-pfbvdfa-driver.o,
+	gimple-pfbvdfa-specs.o, gimple-pfbvdfa-support.o
+	* gcc/basic-block.h (basic_block_def): New variable dfs_number
+	* gcc/common.opt: New -fgdfa and -fgdfa-details.
+	* gcc/gimple-pfbvdfa-support.c: New file. 
+	* gcc/gimple-pfbvdfa-driver.c: New file.
+	* gcc/gimple-pfbvdfa-specs.c: New file. Instantiation of gdfa.
+	* gcc/gimple-pfbvdfa.h: New file. Macros, types, external variables
+	and functions for specifying bvdfa.
+	* gcc/passes.c: New passes pass_init_gimple_pfbvdfa,
+	pass_gimple_pfbv_ave_dfa, pass_gimple_pfbv_pav_dfa, 
+	pass_gimple_pfbv_ant_dfa, pass_gimple_pfbv_lv_dfa,
+	pass_gimple_pfbv_pre_dfa.
+	* gcc/tree-cfg.c (create_bb): Intantiate dfs_number to -1.
+	* gcc/tree-pass.h: Define passes as extern.
+	* gcc/tree.h (tree_base): New variable index.
+
+2008-09-11 Seema Ravandale <ravandaless@gmail.com>
+	
+	* ChangeLog.grc: New file.
diff -Naur gcc-4.3.0/gcc/gimple-pfbvdfa-driver.c gcc-4.3.0/gcc/gimple-pfbvdfa-driver.c
--- gcc-4.3.0/gcc/gimple-pfbvdfa-driver.c	2010-03-21 22:52:49.767717549 +0530
+++ gcc-4.3.0/gcc/gimple-pfbvdfa-driver.c	2009-08-29 22:17:02.000000000 +0530
@@ -298,6 +298,7 @@
 static dfvalue effect_of_a_statement(lp_specs lps_given, tree stmt, dfvalue accumulated_entities);
 static dfvalue exprs_in_statement(tree stmt, lp_specs lps);
 static dfvalue vars_in_statement(tree stmt, lp_specs lps);
+static dfvalue defn_in_statement(tree stmt, lp_specs lps);
         
 /************ End of specification driven local property computation ***********/
 
@@ -307,13 +308,15 @@
 static void print_initial_dfi(void);
 static void print_final_dfi(int count);
 static void print_per_iteration_dfi(int iteration);
+static void print_iteration_number(int iteration);
 
 /************ Lower level functions to print the result of data flow analysis   ***********/
 
 static void dump_dfi(FILE * file, bool in_iterations);
-static void dump_basic_block_info(FILE * file, basic_block bb);
+static void dump_basic_block_info(FILE * file, basic_block bb, char * indent);
 static void dump_entity_list(FILE * file, dfvalue value);
 static void dump_entity_mapping(FILE * file);
+void dump_dfi_for_block(FILE * file, basic_block bb, bool change);
 
 
 /******************* End of the generic dfa driver    *******************/
@@ -323,10 +326,13 @@
 static void verify_allocation_of_dfi(pfbv_dfi **dfi);
 
 extern expr_index_list **exprs_of_vars;
+extern defn_index_list **defns_of_vars;
 extern expr_template **local_expr;
 extern int local_expr_count;
 extern tree * local_var_list;
+extern tree * local_defn_list;
 extern int local_var_count;
+extern int local_defn_count;
 extern int number_of_nodes;
 extern varray_type dfs_ordered_basic_blocks; 
 
@@ -350,13 +356,35 @@
 pfbv_dfi ** 
 gdfa_driver(struct gimple_pfbv_dfa_spec dfa_spec)
 {
+
         if (find_entity_size(dfa_spec) == 0)
                 return NULL;
 
+#if TEST_AVE_FOR_BLOCK_4
+	dfvalue in, gen, kill, out;
+	printf("entity count is %d\n", relevant_pfbv_entity_count);
+
+	gen = make_initialised_dfvalue(ZEROS);
+	kill = make_initialised_dfvalue(ONES);
+        RESET_BIT(kill,3);
+	in = make_initialised_dfvalue(ONES);
+
+	out = a_plus_b_minus_c(gen, in, kill);
+
+	printf("\ngen = ");
+        dump_entity_list(stdout,gen);
+	printf("\nkill = ");
+        dump_entity_list(stdout,kill);
+	printf("\nin = ");
+        dump_entity_list(stdout,in);
+	printf("\nout = ");
+        dump_entity_list(stdout,out);
+#endif
+
+
 	initialise_special_values(dfa_spec);
 
         create_dfi_space(); 
-
         local_dfa(dfa_spec); 
 
         traversal_order = dfa_spec.traversal_order; 
@@ -399,7 +427,8 @@
                         relevant_pfbv_entity_count = local_var_count;
                         break;
                 case entity_defn:
-                        report_dfa_spec_error ("Definitions have not been supported fully yet (Function gdfa_driver)");
+                        relevant_pfbv_entity = entity_defn;
+                        relevant_pfbv_entity_count = local_defn_count;
                         break;
                 default:
                         report_dfa_spec_error ("Wrong choice of entity (Function gdfa_driver)");
@@ -423,29 +452,37 @@
 
         do{        
                 iteration_number++;
+		print_iteration_number(iteration_number);
                 change = false;
                 FOR_EACH_BB_IN_SPECIFIED_TRAVERSAL_ORDER  
                 {         
                         bb = VARRAY_BB(dfs_ordered_basic_blocks,visit_bb);
+#if TEST_GLOBAL_ANALYSIS
+        	        printf ("\nBasic Block %d in outer loop. \n",find_index_bb(bb));
+#endif
+                	dump_basic_block_info(dump_file, bb, "\t");
                         if(bb)
                         {        
                                 if (traversal_order == FORWARD)
                                 {
                                         change_at_in = compute_in_info(bb);
                                         change_at_out = compute_out_info(bb);
+						dump_dfi_for_block(dump_file, bb, change_at_out || change_at_in);
                                         change = change || change_at_out || change_at_in;
                                 }
                                 else if ((traversal_order == BACKWARD) || (traversal_order == BIDIRECTIONAL))
                                 {
                                         change_at_out = compute_out_info(bb);
                                         change_at_in = compute_in_info(bb);
+					if (change_at_out || change_at_in)
+						dump_dfi_for_block(dump_file, bb, change_at_out || change_at_in);
                                         change = change || change_at_in || change_at_out;
                                 }
                                 else 
                                          report_dfa_spec_error ("Direction can only be FORWARD, BACKWARD, or BIDIRECTIONAL (Function perform_pfbvdfa)");
                         }
                 }
-		print_per_iteration_dfi(iteration_number);
+		//print_per_iteration_dfi(iteration_number);
         } while(change);
 
 	print_final_dfi(iteration_number);
@@ -467,6 +504,9 @@
                                      backward_node_flow(bb));
                             
         old = CURRENT_IN(bb);
+#if TEST_GLOBAL_ANALYSIS
+	dump_dfi_for_block(dump_file, bb, true);
+#endif
         change = is_new_info(temp,old);
         if (change)
         {
@@ -753,7 +793,13 @@
                 bb = VARRAY_BB(dfs_ordered_basic_blocks,iter);
                 if (bb)
                 {        
+#if TEST_LOCAL_ANALYSIS
+			 printf ("\n************* Computing Gen\n");
+#endif
                          GEN(current_pfbv_dfi,bb) = local_dfa_of_bb(gen_lps, bb);
+#if TEST_LOCAL_ANALYSIS
+			 printf ("\n************* Computing Kill\n");
+#endif
                          KILL(current_pfbv_dfi,bb) = local_dfa_of_bb(kill_lps, bb);
                 }
                 else
@@ -839,7 +885,19 @@
                         accumulated_entities=a_plus_b_minus_c(add_entities, accumulated_entities, remove_entities);
                         break;
                 case entity_defn:
-                        report_dfa_spec_error ("Local property computation for variables and definitions has not been implemented (Function effect_of_statement)");
+                        add_entities = defn_in_statement(stmt, lps_given);
+			if (lps_given.stmt_effect == entity_use)
+                        {       
+                                lps_temp.entity = lps_given.entity;
+                                lps_temp.exposition = lps_given.exposition;
+                                lps_temp.stmt_effect = entity_mod;
+                                remove_entities = defn_in_statement(stmt, lps_temp);
+                        }
+                        else 
+                        {
+                                remove_entities = make_initialised_dfvalue(ZEROS); 
+                        }
+			accumulated_entities=a_plus_b_minus_c(add_entities, accumulated_entities, remove_entities);
                         break;        
                 default :
                         report_dfa_spec_error ("Wrong choice of entity in local property computation (Function effect_of_statement)");
@@ -850,6 +908,10 @@
                 free_dfvalue_space(add_entities);
         if (remove_entities)
                 free_dfvalue_space(remove_entities);
+#if TEST_LOCAL_ANALYSIS
+		printf("Accumulated entities are ");
+        	dump_entity_list(stdout,accumulated_entities);
+#endif
         return accumulated_entities;
 }
 
@@ -987,6 +1049,86 @@
 }
 
 static dfvalue
+defn_in_statement(tree stmt, lp_specs lps)
+{       
+        dfvalue temp_Gen=NULL;
+        tree defn=NULL,lval=NULL;
+
+        int defn_index=-1, lval_index=-1;
+        
+        if (lps.entity != entity_defn)
+                 report_dfa_spec_error ("Wrong choice of entity in local property computation (Function defn_in_statement)");
+
+        temp_Gen = make_initialised_dfvalue(ZEROS);
+
+
+        /* Find the definition number if statement is definition */
+
+        defn_index = find_index_of_local_defn(stmt);
+
+        /* Find out the l-value of this statement */
+	  
+        lval = extract_lval(stmt);
+        lval_index = find_index_of_local_var(lval);
+        
+        switch (lps.stmt_effect)
+        {        
+               case entity_use:
+                        if (defn_index >= 0 && defn_index < local_defn_count)
+                        {       
+                                SET_BIT(temp_Gen,defn_index);
+
+                                /* Reset the bits of the other definitions of lval */ 
+ 
+                                if(lval_index >=0 && lval_index < local_var_count)
+                                {
+                                        defn_index_list * temp= NULL; 
+                                        for(temp = defns_of_vars[lval_index];temp;temp=temp->next)
+                                        {
+                                                if (temp->defn_no != defn_index && temp->defn_no != -1) 
+                                                {    
+						        
+                                                        switch (lps.exposition)
+                                                        {       
+                                                                case down_exp:
+                                                                case any_where:
+                                                                        RESET_BIT(temp_Gen,temp->defn_no);
+                                                                        break;
+                                                                case up_exp:
+                                                                        break;
+                                                                default:
+                                                                        report_dfa_spec_error ("Wrong choice of occurrence in local property computation (Function defn_in_statement)");
+                                                                        break;
+                                                        }
+						    
+						}
+					}
+                                }
+                        }
+	
+                        break;
+
+                case entity_mod:
+                        if(lval_index >=0 && lval_index < local_var_count) 
+                        {
+                                defn_index_list * temp= NULL; 
+                                for(temp = defns_of_vars[lval_index];temp;temp=temp->next)
+                                {
+                                        if (temp->defn_no != defn_index && temp->defn_no != -1)
+                                                SET_BIT(temp_Gen,temp->defn_no);
+                                 
+                                }
+                        }
+                        break;
+                default: 
+                        report_dfa_spec_error ("Wrong entity manipulation in local property computation (Function defn_in_statement)");
+                        break;
+        }
+        ASSERT (temp_Gen)
+        return temp_Gen;
+}
+
+static dfvalue
 vars_in_statement(tree stmt, lp_specs lps)
 {        
         dfvalue temp_Gen=NULL;
@@ -1008,14 +1150,43 @@
 
         /* Find the expression and its variables occurring in stmt */
         expr = extract_expr(stmt); 
-        if (expr)
-        {
-                left_opd = extract_operand(expr,0);
-                right_opd = extract_operand(expr,1);
-
-                        left_opd_index = find_index_of_local_var(left_opd);
-                        right_opd_index = find_index_of_local_var(right_opd);
+        if (expr) 
+	{
+		/* 	I think we should to bring in tcc_binary etc. */
+		if ((TREE_CODE(expr) != VAR_DECL) && (TREE_CODE(expr) != INTEGER_CST))
+        	{
+                	left_opd = extract_operand(expr,0);
+                	right_opd = extract_operand(expr,1);
+
+	                left_opd_index = find_index_of_local_var(left_opd);
+                	right_opd_index = find_index_of_local_var(right_opd);
+		}
+		else if (TREE_CODE(expr) == VAR_DECL) 
+		{
+                	left_opd = expr;
+	                left_opd_index = find_index_of_local_var(left_opd);
+		}
+		else assert (TREE_CODE(expr) == INTEGER_CST);
+#if 0
+/* 	Need to bring in PARM_DECL */
+		if ((TREE_CODE(expr) == VAR_DECL) || (TREE_CODE(expr) == PARM_DECL)) 
+		{
+                	left_opd = expr;
+	                left_opd_index = find_index_of_local_var(left_opd);
+		}
+		else if (TREE_CODE(expr) == INTEGER_CST)
+			; /* ignore */
+		else
+        	{
+                	left_opd = extract_operand(expr,0);
+                	right_opd = extract_operand(expr,1);
+
+	                left_opd_index = find_index_of_local_var(left_opd);
+                	right_opd_index = find_index_of_local_var(right_opd);
+		}
+#endif
         }
+	
 
 #if TEST_LOCAL_ANALYSIS
         printf ("\n\nGiven Statement is ");
@@ -1038,8 +1209,14 @@
         print_generic_expr(stdout,expr,0);
         printf ("\t Its operands are :");
         print_generic_expr(stdout,left_opd,0);
+	printf("#%d",left_opd_index);
+	if (left_opd)
+		printf("@%d", TREE_CODE(left_opd));
         printf ("\t and :");
         print_generic_expr(stdout,right_opd,0);
+	printf("#%d",right_opd_index);
+	if (right_opd)
+		printf("@%d", TREE_CODE(right_opd));
 #endif
 
         
@@ -1094,7 +1271,8 @@
         ASSERT (temp_Gen)
         return temp_Gen;
 }
-        
+
+       
 /************ End of specification driven local property computation ***********/
 
 /************ Functions to print the result of data flow analysis   ***********/
@@ -1102,11 +1280,14 @@
 dump_dfi(FILE * file, bool in_iterations)
 {
         basic_block bb;
+        int visit_bb=0;
 
 
-        FOR_EACH_BB(bb)
+        FOR_EACH_BB_IN_SPECIFIED_TRAVERSAL_ORDER  
         {         
-                dump_basic_block_info(file, bb);
+                 bb = VARRAY_BB(dfs_ordered_basic_blocks,visit_bb);
+	
+                dump_basic_block_info(file, bb, "");
 
                 /* DO not print GEN and KILL during iterations */
                 if (! in_iterations)
@@ -1162,25 +1343,39 @@
 
 
 static void
-dump_basic_block_info(FILE * file, basic_block bb)
+dump_basic_block_info(FILE * file, basic_block bb, char * indent)
 {
         VEC(edge, gc) *edge_vec;
         edge e;
         edge_iterator ei;
         basic_block pred_bb, succ_bb;
+	int bb_num, dfs_num;
+
+        if (!flag_gdfa_details)    
+		return;
 
-        fprintf (file, "\nBasic Block %d. Preds: ",find_index_bb(bb));
+        //fprintf (file, "\nBasic Block %d. Preds: ",find_index_bb(bb));
+        fprintf (file, "\n%sBasic Block ", indent);
+	bb_num = find_index_bb(bb);
+	dfs_num = find_dfs_number(bb);
+
+	if (bb == ENTRY_BLOCK_PTR)
+		fprintf (file, "ENTRY. DFS Number %d. Preds:",dfs_num);
+	else if (bb == EXIT_BLOCK_PTR)
+		fprintf (file, "EXIT. DFS Number %d. Preds:",dfs_num);
+	else
+		fprintf (file, "%d. DFS Number %d. Preds:",bb_num,dfs_num);
 
         edge_vec = bb->preds;
         if (!edge_vec)
-                fprintf (file, "None ");
+                fprintf (file, " None");
                 
         else
         {         
                 FOR_EACH_EDGE(e,ei,edge_vec)
                 {
                         pred_bb = e->src;
-                        if (pred_bb->index == 0)
+                        if (pred_bb == ENTRY_BLOCK_PTR)
                                 fprintf (file, " ENTRY");
                         else
                         fprintf (file, " %d",find_index_bb(pred_bb));
@@ -1189,14 +1384,14 @@
         fprintf (file, ". Succs: ");
         edge_vec = bb->succs;
         if (!edge_vec)
-                fprintf (file, "None ");
+                fprintf (file, " None");
                 
         else
         {         
                 FOR_EACH_EDGE(e,ei,edge_vec)
                 {
                         succ_bb = e->dest;
-                        if (succ_bb->index == 1)
+                        if (succ_bb == EXIT_BLOCK_PTR)
                                 fprintf (file, " EXIT");
                         else
                                 fprintf (file, " %d",find_index_bb(succ_bb));
@@ -1223,8 +1418,11 @@
                                 case entity_var:
                                         expr = local_var_list[i];
                                         break;
+				case entity_defn:
+					expr = local_defn_list[i];
+					break;
                                 default:
-                                        report_dfa_spec_error("Only expressions and variables are supported at the moment (Function dump_entity_list)");
+                                        report_dfa_spec_error("Only expressions,variables,definitions are supported at the moment (Function dump_entity_list)");
                                         break;
                         }
                         if (expr)
@@ -1257,8 +1455,11 @@
                         case entity_var:
                                 expr = local_var_list[i];
                                 break;
+			case entity_defn:
+				expr = local_defn_list[i];
+				break;
                         default:
-                                report_dfa_spec_error("Only expressions and variables are supported at the moment (Function dump_entity_mapping)");
+                                report_dfa_spec_error("Only expressions,variables and definitions are supported at the moment (Function dump_entity_mapping)");
                                 break;
                 }
                 if (expr)
@@ -1318,13 +1519,25 @@
 {
         if (flag_gdfa_details)    
         {
-               fprintf(dump_file, "\n Values after iteration %d *************\n",iteration);
+               fprintf(dump_file, "\n\nValues after iteration %d *************\n",iteration);
                dump_dfi(dump_file, true);
         }
 
 
 }
 
+static void 
+print_iteration_number(int iteration)
+{
+        if (flag_gdfa_details)    
+        {
+               fprintf(dump_file, "\n\nValues after iteration %d *************\n",iteration);
+        }
+
+
+}
+
+
 
 /******************* End of the generic dfa driver    *******************/
 
@@ -1350,3 +1563,40 @@
         }
 }
 
+void
+dump_dfi_for_block(FILE * file, basic_block bb, bool change)
+{
+
+        if (!flag_gdfa_details)    
+		return;
+
+	if (!change)
+	{
+                fprintf (file, "\n\t\tNo change");
+	}
+	else
+	{
+        	if (IN(current_pfbv_dfi,bb) == NULL)
+                	fprintf (stderr, "\nBasic Block %d: Null In value\n", find_index_bb(bb));
+        	else 
+        	{       
+                	fprintf (file, "\n\t\t------------------------------");
+                	fprintf (file, "\n\t\tIN Bit Vector:  ");
+                	dump_dfvalue(file,IN(current_pfbv_dfi,bb));
+                	fprintf (file, "\t\tIN Entities:      ");
+                	dump_entity_list(file,IN(current_pfbv_dfi,bb));
+        	}
+	
+        	if (OUT(current_pfbv_dfi,bb) == NULL)
+                	fprintf (stderr, "\nBasic Block %d: Null Out value\n", find_index_bb(bb));
+        	else 
+        	{       
+                	fprintf (file, "\n\t\t------------------------------");
+                	fprintf (file, "\n\t\tOUT Bit Vector: ");
+                	dump_dfvalue(file,OUT(current_pfbv_dfi,bb));
+                	fprintf (file, "\t\tOUT Entities:     ");
+                	dump_entity_list(file,OUT(current_pfbv_dfi,bb));
+                	fprintf (file, "\n\t\t------------------------------");
+        	}
+	}
+}
diff -Naur gcc-4.3.0/gcc/gimple-pfbvdfa.h gcc-4.3.0/gcc/gimple-pfbvdfa.h
--- gcc-4.3.0/gcc/gimple-pfbvdfa.h	2010-03-21 22:52:49.767717549 +0530
+++ gcc-4.3.0/gcc/gimple-pfbvdfa.h	2009-08-29 22:17:03.000000000 +0530
@@ -28,6 +28,12 @@
         struct expr_index_list *next;
 }expr_index_list;
 
+typedef struct defn_index_list
+{
+        int defn_no;
+        struct defn_index_list *next;
+}defn_index_list;
+
 
 /*Data structure to store expression template*/
 typedef struct expr_template
@@ -59,7 +65,7 @@
 
 #define FOR_EACH_BB_IN_SPECIFIED_TRAVERSAL_ORDER         \
         for( visit_bb = (traversal_order == FORWARD)?  0 :  number_of_nodes -1 ;\
-            (traversal_order == FORWARD)? visit_bb < number_of_nodes  -1 \
+            (traversal_order == FORWARD)? visit_bb < number_of_nodes  \
                                         : visit_bb >=0 ; \
             (traversal_order == FORWARD)? visit_bb++ \
                                         : visit_bb-- \
@@ -186,10 +192,12 @@
 dfvalue make_initialised_dfvalue(initial_value value);
 dfvalue make_uninitialised_dfvalue(void);
 void dump_dfvalue (FILE * file, dfvalue value);
+void dump_dfi_for_block(FILE * file, basic_block bb, bool change);
 
 /* helper functions */
 
 int find_index_bb(basic_block bb);
+int find_dfs_number(basic_block bb);
 void report_dfa_spec_error(const char * mesg);
 tree extract_expr(tree stmt);
 tree extract_lval(tree stmt);
diff -Naur gcc-4.3.0/gcc/gimple-pfbvdfa-specs.c gcc-4.3.0/gcc/gimple-pfbvdfa-specs.c
--- gcc-4.3.0/gcc/gimple-pfbvdfa-specs.c	2010-03-21 22:52:49.767717549 +0530
+++ gcc-4.3.0/gcc/gimple-pfbvdfa-specs.c	2009-08-29 22:17:04.000000000 +0530
@@ -365,3 +365,58 @@
 
         return temp2; 
 }
+
+/************* Specification of Reaching defination analysis *****************/
+
+pfbv_dfi ** RD_pfbv_dfi = NULL;
+
+static unsigned int gimple_pfbv_rd_dfa(void);
+
+struct gimple_pfbv_dfa_spec gdfa_rd = 
+{
+        entity_defn,                   /* entity;                 */
+        ZEROS,                         /* top_value;              */
+        ZEROS, 			       /* entry_info;             */
+        ZEROS,                         /* exit_info;              */
+        FORWARD,                       /* traversal_order;        */
+        UNION,                         /* confluence;             */
+        entity_use,                    /* gen_effect;             */
+        down_exp,                      /* gen_exposition;         */
+        entity_mod,                    /* kill_effect;            */
+        any_where,                     /* kill_exposition;        */
+        global_only,                   /* preserved_dfi;          */
+        identity_forward_edge_flow,    /* forward_edge_flow       */
+        stop_flow_along_edge,          /* backward_edge_flow      */
+        forward_gen_kill_node_flow,    /* forward_node_flow       */
+        stop_flow_along_node           /* backward_node_flow      */
+};
+
+static unsigned int
+gimple_pfbv_rd_dfa(void)
+{
+
+        RD_pfbv_dfi = gdfa_driver(gdfa_rd);
+
+        return 0;
+}
+
+
+/* This is the specification of rd (Reaching defination) pass in GCC */
+
+struct tree_opt_pass pass_gimple_pfbv_rd_dfa =
+{
+  "gdfa_rd",                          /* name */
+  NULL,                               /* gate */
+  gimple_pfbv_rd_dfa,                 /* 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_finish */
+  0                                   /* letter */
+};
+
diff -Naur gcc-4.3.0/gcc/gimple-pfbvdfa-support.c gcc-4.3.0/gcc/gimple-pfbvdfa-support.c
--- gcc-4.3.0/gcc/gimple-pfbvdfa-support.c	2010-03-21 22:52:49.767717549 +0530
+++ gcc-4.3.0/gcc/gimple-pfbvdfa-support.c	2009-08-29 22:17:04.000000000 +0530
@@ -69,50 +69,68 @@
                       uninteresting_var_type
                 } var_scope;
 
+typedef enum defnT  
+                {  
+                      locally_scoped_defn=1,
+                      globally_scoped_defn,
+                      artificial_defn,
+                      temporary_defn,
+                      uninteresting_defn_type
+                } defn_scope;
+
+
+#define LOCALISED_VERSION(var)  DECL_IGNORED_P ((var)) == 1 && \ 
+				DECL_ARTIFICIAL((var)) == 1 && \
+                              	DECL_SEEN_IN_BIND_EXPR_P((var)) == 1  && \
+                                DECL_NAME((var))
 
-#define LOCALISED_VERSION(var)  (var)->decl_common.ignored_flag==1 && \
-                                (var)->decl_common.artificial_flag==1 && \
-                                (var)->decl_with_vis.seen_in_bind_expr==1 && \
-                                (var)->decl_minimal.name
-
-#define GROW_STEP 2
+#define GROW_STEP 10
 
 #define ENTITY_INDEX(node) (node).common.base.index
 
-
 /*initial allocation of memory while storing expressions */
 int e_old_size_local=1000,e_new_size_local=100;
 
 /*initial allocation of memory while storing variables */
 int v_old_size_local=1000,v_new_size_local=100;
- 
-/* Array stores count of local entity count per procedure, indexed by function_id
-and is of size functioncount*/
+
+/*initial  allocation of memory while storing definitions */
+int d_old_size_local=1000,d_new_size_local=100;	
+
+/* Count of local entities */
 int local_var_count=0;
 int local_expr_count=0;
+int local_defn_count=0;
 int number_of_nodes=0;
 
- /*local_var_array we are storing temporarily for a function under 
- * compilation, used to assign indices to local copies of local variable*/
-
-expr_template **local_expr=NULL,**temp_expr=NULL;
+expr_template **local_expr=NULL;
 expr_index_list **exprs_of_vars=NULL;
 
+ /* local_var_list, we are storing temporarily for a function under 
+ * compilation, used to assign indices to local copies of local variable*/
+
 tree * local_var_list=NULL;
+tree * local_defn_list=NULL;
+defn_index_list **defns_of_vars=NULL;
 
 varray_type dfs_ordered_basic_blocks = NULL; 
 basic_block * stack_bb=NULL;
 
 /**  Functions to assign indices to local expressions, variables, and definitions **/
 
-static void assign_indices_to_local_var(void);
+static void assign_indices_to_var(void);
 static void assign_indices_to_exprs(void);
 static void assign_indices_to_local_expr(tree expr);
+static void assign_indices_to_defn();
 
 static void create_add_node_expr_index_list( int expr_index, expr_index_list **list,int index);
 static expr_index_list* create_node_expr_index_list(int expr_index);
 static void add_to_list_expr(expr_index_list **list_head,int var,expr_index_list * temp_node);
 
+static void create_add_node_defn_index_list(int defn_index, defn_index_list **list,int index);
+static defn_index_list* create_node_defn_index_list(int defn_index);
+static void add_to_list_defn(defn_index_list **list_head,int var,defn_index_list * temp_node);
+
 static signed int index_of_operand(tree operand);
 static bool is_expr_in_template(expr_template **template, int iter, tree expr, tree op0, tree op1);
 static void validate_expr_index_list(void);
@@ -130,22 +148,26 @@
 static basic_block pop_bb(void);
 
 /**  Accessor functions for entities in gimple IR **/
-static var_scope type_of_var(tree var)        ;
+static var_scope type_of_var(tree var);
 static bool is_local_expr(tree expr);
 static bool is_valid_expr(tree expr);
+static bool is_simple_expr(tree expr);
 static char * extract_string(tree var);
-
-
+static defn_scope type_of_defn(tree defn);
+static bool is_valid_defn(tree stmt);
+static bool is_global_var_grc (tree var);
 
 static unsigned int
 init_gimple_pfbvdfa_execute (void)
 {
         local_var_count=0;
         local_expr_count=0;
-        number_of_nodes = n_basic_blocks+2;
+	local_defn_count=0;
+        number_of_nodes = n_basic_blocks;
 
-        assign_indices_to_local_var();
+        assign_indices_to_var();
         assign_indices_to_exprs();
+	assign_indices_to_defn();
 
         dfs_ordered_basic_blocks = NULL; 
         dfs_numbering_of_bb();
@@ -175,24 +197,28 @@
 
 
 static void 
-assign_indices_to_local_var(void)
+assign_indices_to_var(void)
 {
-        tree vars,list;
+        tree vars,list, decl;
         char * var_name,*position_ptr=NULL,*var_temp=NULL;
         size_t position=0;
 
         /*data structure to store all expression templates */
-        local_var_list = (tree *)ggc_alloc_cleared(sizeof(tree *)*v_old_size_local);
+        local_var_list = (tree *)ggc_alloc_cleared(sizeof(tree )*v_old_size_local);
 
         list = cfun->unexpanded_var_list;
         while (list) 
         {
-                if(local_var_count == v_new_size_local)
+                if(local_var_count == v_old_size_local)
                 {
-                        v_new_size_local += v_old_size_local;
-                        local_var_list =(tree *) ggc_realloc(local_expr,sizeof(tree )*v_new_size_local);
+                        v_old_size_local += v_new_size_local;
+                        local_var_list =(tree *) ggc_realloc(local_var_list,sizeof(tree )*v_old_size_local);
                 }
                 vars = TREE_VALUE (list);
+#if TEST_LOCAL_ANALYSIS
+		printf ("\nVariable in in unexpanded var list");
+		print_generic_expr(stdout, vars, 0);
+#endif
 
                 switch(type_of_var(vars))
                 {
@@ -223,15 +249,49 @@
                         case temporary_var: 
                         case artificial_var:
                         case globally_scoped_var:
+			case uninteresting_var_type:
                                 ENTITY_INDEX(vars->decl_minimal) = -1;
                                 break;
                         default:
-                                report_dfa_spec_error ("Which type of variable is this? (Function assign_indices_to_local_var)");
+                                report_dfa_spec_error ("Which type of variable is this? (Function assign_indices_to_var)");
                                        break; 
 
                 }
+#if TEST_LOCAL_ANALYSIS
+					printf (" #%d", ENTITY_INDEX(vars->decl_minimal) );
+					printf("@%d\n",TREE_CODE(vars));
+#endif
                 list = TREE_CHAIN(list);
         }
+#if 0
+
+	Removed for the time being..
+
+	/* Now assign indices to parameters */
+        decl = DECL_ARGUMENTS(cfun->decl);
+	while (decl)
+	{
+		if (TREE_CODE(decl) == PARM_DECL)
+		{
+#if TEST_LOCAL_ANALYSIS
+			printf ("\nVariable in parameter list");
+			print_generic_expr(stdout, decl, 0);
+#endif
+                	if(local_var_count == v_old_size_local)
+                	{
+                        	v_old_size_local += v_new_size_local;
+                        	local_var_list =(tree *) ggc_realloc(local_var_list,sizeof(tree )*v_old_size_local);
+                	}
+                        ENTITY_INDEX(decl->decl_minimal) = local_var_count;
+                        local_var_list[local_var_count++] = decl;
+#if TEST_LOCAL_ANALYSIS
+			printf (" #%d", ENTITY_INDEX(decl->decl_minimal) );
+			printf("@%d\n",TREE_CODE(decl));
+#endif
+		}
+                decl = TREE_CHAIN(decl);
+	}
+#endif
 }
 
 
@@ -253,6 +313,24 @@
 
 }        
 
+static void
+create_add_node_defn_index_list( int defn_index, defn_index_list **list,int index)
+{
+        defn_index_list *temp=NULL;
+        temp=(defn_index_list*)ggc_alloc_cleared(sizeof(defn_index_list));
+        temp->defn_no = defn_index;
+        temp->next = NULL;
+
+        if(list[index]==NULL)
+                list[index] = temp;
+        else
+        {
+                temp->next = list[index];
+                list[index]=temp;
+        }
+
+}        
+
 static signed int 
 index_of_operand(tree operand)
 {
@@ -305,23 +383,23 @@
 
                 bool cmp_expr =  is_expr_in_template( local_expr,iter_local_expr,expr,op0,op1);
                         
-                        /*if expr is in array local_expr, do nothing*/ 
+                /*if expr is in array local_expr, do nothing*/ 
                 if(cmp_expr)
                 {
                         ENTITY_INDEX(*expr) = iter_local_expr;
                         return;
                 }
-           }
+         }
 
         /* This is a new expression that needs to be assigned an index */
         /* We need to store it in the array*/
               
         /* First check if there is a need to dynamically increase the 
            allocated size of the array that remembers expressions. */
-        if(local_expr_count == e_new_size_local)
+        if(local_expr_count == e_old_size_local)
         {
-                e_new_size_local += e_old_size_local;
-                local_expr =(expr_template**) ggc_realloc(local_expr,sizeof(expr_template*)*e_new_size_local);
+                e_old_size_local += e_new_size_local;
+                local_expr =(expr_template**) ggc_realloc(local_expr,sizeof(expr_template*)*e_old_size_local);
         }
                         
         if(iter_local_expr == local_expr_count)
@@ -337,7 +415,7 @@
                                 break;
 
                         case INTEGER_CST:
-                                op1_index = -1;
+                                op0_index = -1;
                                 /* store the value of int constant at op1_index field */        
                                 local_expr[local_expr_count]->op0_index = TREE_INT_CST_LOW(op0);
                                 break;
@@ -403,7 +481,12 @@
                         logical_stmt_no++;
 
                         expr = extract_expr(stmt);
-                        if(expr)
+			/* 
+				Exclude simple right hand sides from being considered as expressions 
+   				Uday: 26 Aug 2009
+			*/
+                       /* if(expr) */
+        		if ((expr) && (TREE_CODE(expr) != VAR_DECL) && (TREE_CODE(expr) != INTEGER_CST))
                         {
                                 if(is_local_expr(expr))
                                         assign_indices_to_local_expr(expr);
@@ -415,7 +498,67 @@
         
 }
 
+static void 
+assign_indices_to_defn(void)
+{
+	basic_block bb;
+        block_stmt_iterator bsi;
+	int index;
+        defn_scope type;
+        tree stmt=NULL,lval=NULL;
+
+	/*data structure to store all definitions*/ 
+        local_defn_list = (tree *)ggc_alloc_cleared(sizeof(tree )*d_old_size_local);
+
+        /*data structure to accumulate definitions of a given variable */
+        defns_of_vars  =(defn_index_list**)ggc_alloc_cleared(sizeof(*defns_of_vars)*local_var_count);
+ 
+        FOR_EACH_BB_FWD(ENTRY_BLOCK_PTR)
+        {
+                int logical_stmt_no =0;
+                FOR_EACH_STMT_FWD
+                {
+                        stmt = bsi_stmt(bsi);
+                        logical_stmt_no++;
 
+                        if(is_valid_defn(stmt))
+			{	
+				if(local_defn_count == d_old_size_local)
+		                {
+                	   		d_old_size_local += d_new_size_local;
+                        		local_defn_list =(tree *) ggc_realloc(local_defn_list,sizeof(tree )*d_old_size_local);
+                		}
+
+				type = type_of_defn(stmt);
+				switch (type)
+				{
+					case locally_scoped_defn:
+						ENTITY_INDEX(*stmt) = local_defn_count;
+						local_defn_list[local_defn_count] = stmt;
+						lval = extract_operand(stmt,0);
+						index = ENTITY_INDEX(*lval);
+						create_add_node_defn_index_list(local_defn_count,defns_of_vars,index);
+						local_defn_count++;
+
+						break;
+
+					case globally_scoped_defn:
+			                case artificial_defn:
+                      			case temporary_defn:
+					case uninteresting_defn_type:
+						ENTITY_INDEX(*stmt) = -1;
+						break;
+
+					default:
+				                report_dfa_spec_error ("Which type of definition is this? (Function assign_indices_to_defn)");
+						break;
+				}	
+			}
+			
+		}/* for loop of BSI(stmt)*/
+        }/*For loop for bb*/
+    
+}
 
 static void
 validate_expr_index_list(void)
@@ -542,12 +685,15 @@
         {
                 succ_bb = e->dest;
                 if(!visit_dfs[succ_bb->index])
-                dfs_numbering_of_bb_inner(succ_bb);
+                	dfs_numbering_of_bb_inner(succ_bb);
         }
-
         VARRAY_BB(dfs_ordered_basic_blocks,--dfs_num) = bb;
         bb->dfs_number = dfs_num;
 
+#if TEST_GLOBAL_ANALYSIS
+       printf ("\nBasic Block %d with dfs number %d from among %d\n",find_index_bb(bb), dfs_num, number_of_nodes);
+#endif
+
 }
 #endif
 
@@ -600,57 +746,125 @@
         return bb;
 }
 
-        /* here bb->index will correspond to itself
-         * except for ENTRY_BLOCK_PTR which is now (number_of_nodes-2)
-         * and        EXIT_BLOCK_PTR = number_of_nodes-1;
-         */
-
-
-
 int
 find_index_bb(basic_block bb)
 {
-                int nid;
-                /*if ENTRY_BLOCK*/
-                if(bb->index == -1)
-                        nid = number_of_nodes-2;
-                /*else if EXIT_BLOCK*/
-                else if (bb->index  == -2)
-                        nid = number_of_nodes-1;
-                else if (bb->index >=0 && bb->index < n_basic_blocks)
+                int nid = -1;
+                if (bb->index >=0 && bb->index < n_basic_blocks)
                          nid = bb->index;
                 else 
-                        nid = number_of_nodes-2;
+	                report_dfa_spec_error ("Wrong index of basic block (Function find_index_bb)");
+                return nid;
+}
+
+int
+find_dfs_number(basic_block bb)
+{
+                int nid = -1;
+                if (bb->index >=0 && bb->index < n_basic_blocks)
+                         nid = bb->dfs_number;
+                else 
+	                report_dfa_spec_error ("Wrong index of basic block (Function find_index_bb)");
                 return nid;
 }
 
 
+
 /**  End of functions to perform depth first numbering of gimple cfg  **/
 
 /**  Accessor functions for entities in gimple IR **/
 
+#if 0
 static var_scope
 type_of_var(tree var)
 {
-
+      if(TREE_CODE(var) == VAR_DECL) 
+      {	
         if(var->decl_minimal.name == NULL)
                 return temporary_var;
-        else
+        else if (LOCALISED_VERSION(var)) 
         {
-                if(LOCALISED_VERSION(var))
-                {        
-                        /*variable is local copy of some global variable
-                          or local copy of local variable. This includes
-                          versions such as c.0 for local var c also.
-                        */
-                        return artificial_var;
-                }        
-                /* if not local version of global var and not temporary var then pure local variable*/
-                if (is_global_var(var)) 
-                        return globally_scoped_var;
-                else
-                        return locally_scoped_var;
-        }
+		/*variable is local copy of some global variable
+		or local copy of local variable. This includes
+		versions such as c.0 for local var c also.
+		*/
+		return artificial_var;
+	}        
+	else if (is_global_var_grc(var))  
+		return globally_scoped_var;
+	else 	/* if not local version of global var and not temporary var then pure local variable*/
+		return locally_scoped_var;
+      }
+      else
+	return uninteresting_var_type;
+
+}
+#endif
+
+static var_scope
+type_of_var(tree var)
+{
+      var_scope scope;
+
+      if(TREE_CODE(var) == VAR_DECL) 
+      {	
+#if TEST_LOCAL_ANALYSIS
+	printf ("\nVariable is ");
+	print_generic_expr(stdout, var, 0);
+#endif
+
+        if(var->decl_minimal.name == NULL)
+                scope = temporary_var;
+        else if (LOCALISED_VERSION(var)) 
+        { /*variable is local copy of some global variable or local copy of local variable. This includes versions such as c.0 for local var c also.
+		*/
+		scope = artificial_var;
+	}        
+	else if (is_global_var_grc(var))  
+		scope = globally_scoped_var;
+	else 	/* if not local version of global var and not temporary var then pure local variable*/
+		scope = locally_scoped_var;
+
+#if TEST_LOCAL_ANALYSIS
+	printf("with scope ");
+	switch (scope)
+	{
+		case temporary_var:
+			printf ("temporary");
+			break;
+		case artificial_var:
+			printf ("artificial");
+			break;
+		case globally_scoped_var:
+			printf ("global");
+			break;
+		case locally_scoped_var:
+			printf ("local");
+			break;
+	}
+#endif
+      }
+      else
+	scope = uninteresting_var_type;
+
+      return scope;
+
+}
+
+
+/* This function has given "grc" suffix, because is_global_var function is already provided by
+ * GCC, but it return true on static_flag, which could be true for static local variables. */
+ 
+static bool
+is_global_var_grc (tree var)
+{
+	bool return_value = false;
+	return_value = ( TREE_STATIC(var)==1 && 
+			 TREE_PUBLIC(var)==1 && 
+			 DECL_SEEN_IN_BIND_EXPR_P(var)==0);
+			/* Even check on context field which is NULL for global 
+			variable can be added */
+	return return_value;
 }
 
 static bool
@@ -697,8 +911,32 @@
 
         if (var)
         {        
-                if((TREE_CODE(var) == VAR_DECL) && (ENTITY_INDEX(*var) != -1 ))
-                        index = ENTITY_INDEX(*var);
+                if(
+			((TREE_CODE(var) == VAR_DECL) && (type_of_var(var) == locally_scoped_var)) 
+			/* 
+				Removed for the time being. 
+			|| (TREE_CODE(var) == PARM_DECL)
+			*/
+		  )
+		{
+                        index = ENTITY_INDEX(var->decl_minimal);
+#if TEST_LOCAL_ANALYSIS
+			printf("\n local variable in find_index");
+        		print_generic_expr(stdout,var,0);
+			printf("#%d",index);
+			printf("@%d\n",TREE_CODE(var));
+#endif
+		}
+		else
+		{
+#if TEST_LOCAL_ANALYSIS
+                        index = ENTITY_INDEX(var->decl_minimal);
+			printf("\n variable that is not a local variable in find_index");
+        		print_generic_expr(stdout,var,0);
+			printf("#%d",index);
+			printf("@%d\n",TREE_CODE(var));
+#endif
+		}
         }
         return index;
 }
@@ -708,7 +946,11 @@
 {       
         int index=-1;        
 
-        if (expr)
+/* 
+	Exclude simple right hand sides from being considered as expressions 
+   	Uday: 26 Aug 2009
+*/
+        if ((expr) && (TREE_CODE(expr) != VAR_DECL) && (TREE_CODE(expr) != INTEGER_CST))
         {        
                 if (is_local_expr(expr))
                         index = ENTITY_INDEX(*expr);
@@ -716,9 +958,18 @@
         return index;
 }
 
-
-
-
+int 
+find_index_of_local_defn(tree defn)
+{
+	int index=-1;
+	if(defn && is_valid_defn(defn))
+	{
+		if(type_of_defn(defn) == locally_scoped_defn)
+		index = ENTITY_INDEX(*defn);
+	}
+	
+	return index;
+}
 static bool
 is_valid_expr(tree expr)
 {
@@ -753,6 +1004,30 @@
         return valid;
 }
 
+static bool
+is_simple_expr(tree expr)
+{
+        bool valid;
+
+        switch(TREE_CODE(expr))
+        { 
+                case VAR_DECL:
+/*	
+	Removed for the time being.
+                case PARM_DECL:
+*/
+                case INTEGER_CST:
+                        valid = true;
+                        break;
+                default:
+                        valid = false;
+                        break;
+                                
+        }
+        return valid;
+}
+
+
 /**Arguments :variable pointer
 Checks to see that the var passed is not a temp var then,
   Returns : the string ie. name of the variable **/
@@ -768,6 +1043,65 @@
                 var_name = NULL;
         return var_name;
 }
+
+static bool
+is_valid_defn(tree stmt)
+{
+	switch(TREE_CODE(stmt))
+	{	
+		case MODIFY_EXPR:
+		case GIMPLE_MODIFY_STMT:
+			return true;
+			break;
+		default:
+			return false;
+			break;
+	}
+
+}
+
+/* 
+There are four kinds of possible definitions
+[locally_scoped_defn]	al   = .... ; where "al" is some local variable
+[globally_scoped_defn]  ag   = .... ; where "ag" is some global variable
+[artificial_defn]   	ag.0 = .... ; where ag.0 is local copy of some global variable
+[temorary_defn] 	t123 = .... ; where t123 is a temprary variable created for intermediate computations is complex exression (Gimple IR specific)i
+*/
+ 
+static defn_scope
+type_of_defn(tree defn)
+{
+	tree lval=NULL;
+	var_scope type;
+	/* Fix me: Can be used extract_lval, but currently it's returning only for locals*/
+	lval = extract_operand(defn,0);
+	if ( lval && TREE_CODE(lval) == VAR_DECL)
+	{
+		type = type_of_var(lval);
+		switch(type)
+		{
+			case locally_scoped_var:
+				return locally_scoped_defn;
+				break;
+
+			case globally_scoped_var:
+				return globally_scoped_defn;
+				break;
+			case artificial_var:
+				return artificial_defn;
+				break;
+			case temporary_var: 
+				return temporary_defn;
+				break;
+                        default:
+				return uninteresting_defn_type;
+				break;
+		}
+	}
+
+	return uninteresting_defn_type;
+}
+
 /**  End of accessor functions for entities in gimple IR **/
 
 /** End of local functions **/
@@ -781,22 +1115,43 @@
         {
                 case COND_EXPR:
                                 expr = extract_operand(stmt,0);
+#if TEST_LOCAL_ANALYSIS
+				printf ("\nConditional Statement is ");
+				print_generic_expr(stdout,stmt,0);
+				printf ("Condition is ");
+				print_generic_expr(stdout,expr,0);
+#endif
                                 break;
                 case MODIFY_EXPR:
                 case GIMPLE_MODIFY_STMT:
                                 lval = extract_operand(stmt,0);
                                 expr = extract_operand(stmt,1);
                                 
-                                /*Skip modify expressions of type a.0 = a*/
-                                if( TREE_CODE(expr) == VAR_DECL && ENTITY_INDEX(*lval) == ENTITY_INDEX(*expr) 
+                                /* Skip assignment statements of type a.0 = a*/
+                                if( TREE_CODE(expr) == VAR_DECL 
+					&& ENTITY_INDEX(lval->decl_minimal) == ENTITY_INDEX(expr->decl_minimal) 
+					&& (type_of_var(lval) == artificial_var)
                                    )
                                         expr = NULL;
+#if TEST_LOCAL_ANALYSIS
+				printf ("\nAssignment Statement is ");
+				print_generic_expr(stdout,stmt,0);
+				printf ("LHS is ");
+				print_generic_expr(stdout,lval,0);
+				printf ("RHS is ");
+				print_generic_expr(stdout,expr,0);
+#endif
                                 break;
                 default:
                                 expr = NULL;
         }
-        if(expr && is_valid_expr(expr))
-                return expr;
+        if(expr)
+	{	
+		if(is_simple_expr(expr) || is_valid_expr(expr))
+                	return expr;
+                else 
+			return NULL;
+	}	
         else 
                 return NULL;
         
@@ -819,7 +1174,6 @@
                         break;
         }
         return lval;
-        
 }
 
 tree 
diff -Naur gcc-4.3.0/gcc/passes.c gcc-4.3.0/gcc/passes.c
--- gcc-4.3.0/gcc/passes.c	2010-03-21 22:52:49.781211165 +0530
+++ gcc-4.3.0/gcc/passes.c	2010-03-21 22:46:50.227723434 +0530
@@ -490,6 +490,7 @@
   NEXT_PASS (pass_gimple_pfbv_ant_dfa);
   NEXT_PASS (pass_gimple_pfbv_lv_dfa);
   NEXT_PASS (pass_gimple_pfbv_pre_dfa);
+  NEXT_PASS (pass_gimple_pfbv_rd_dfa);
 /* Intraprocedural dfa passes end */
   NEXT_PASS (pass_lower_complex_O0);
   NEXT_PASS (pass_lower_vector);
diff -Naur gcc-4.3.0/gcc/tree-cfg.c gcc-4.3.0/gcc/tree-cfg.c
--- gcc-4.3.0/gcc/tree-cfg.c	2010-03-21 22:52:49.788716939 +0530
+++ gcc-4.3.0/gcc/tree-cfg.c	2010-03-21 22:46:50.227723434 +0530
@@ -133,6 +133,8 @@
   SET_BASIC_BLOCK (EXIT_BLOCK, EXIT_BLOCK_PTR);
   ENTRY_BLOCK_PTR->next_bb = EXIT_BLOCK_PTR;
   EXIT_BLOCK_PTR->prev_bb = ENTRY_BLOCK_PTR;
+  ENTRY_BLOCK_PTR->dfs_number = -1;
+  EXIT_BLOCK_PTR->dfs_number  = -1;
 }
 
 /*---------------------------------------------------------------------------
@@ -371,10 +373,9 @@
   bb->flags = BB_NEW;
   bb->il.tree = GGC_CNEW (struct tree_bb_info);
   set_bb_stmt_list (bb, h ? (tree) h : alloc_stmt_list ());
-
-/*--------------- Start: Seema -------------------*/
+  
+  /* Set dfs_number to -1, later this field will be initialised in gdfa */
   bb->dfs_number = -1;
-/*--------------- End: Seema -------------------*/
 
   /* Add the new block to the linked list of blocks.  */
   link_block (bb, after);
diff -Naur gcc-4.3.0/gcc/tree.h gcc-4.3.0/gcc/tree.h
--- gcc-4.3.0/gcc/tree.h	2010-03-21 22:52:49.791731289 +0530
+++ gcc-4.3.0/gcc/tree.h	2010-03-21 22:46:50.231733162 +0530
@@ -404,12 +404,11 @@
   /* FIXME tuples: Eventually, we need to move this somewhere external to
      the trees.  */
   union tree_ann_d *ann;
-/*--------------- Start: Seema ---------------*/
+
   /* This index is used for data flow analysis, which willspecify index
    * of entity under considaration, i.e. variable, expression etc
    */
   signed int index;
-  /*--------------- End: Seema ---------------*/
 
 };
 
diff -Naur gcc-4.3.0/gcc/tree-pass.h gcc-4.3.0/gcc/tree-pass.h
--- gcc-4.3.0/gcc/tree-pass.h	2010-03-21 22:52:49.791731289 +0530
+++ gcc-4.3.0/gcc/tree-pass.h	2010-03-21 22:46:50.235742051 +0530
@@ -455,6 +455,7 @@
 extern struct tree_opt_pass pass_gimple_pfbv_ant_dfa;
 extern struct tree_opt_pass pass_gimple_pfbv_lv_dfa;
 extern struct tree_opt_pass pass_gimple_pfbv_pre_dfa;
+extern struct tree_opt_pass pass_gimple_pfbv_rd_dfa;
 
 /* The root of the compilation pass tree, once constructed.  */
 extern struct tree_opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes;
