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]

[PATCH] Release some SSA_NAMEs


Attached is a patch suggested by Zdenek to release SSA_NAMEs that
become disused as a result of basic block merging. More work appears
to be required to release all virtual SSA_NAMEs that become disused,
but in my testing this patch seems sufficient to be able to iterate
simply over all real (non-virtual) SSA_NAMEs currently in use.

Bootstrapped and tested on i686-pc-linux-gnu.

	-- Robert Kennedy

		    ------------------------------

2007-01-02  Robert Kennedy <jimbob@google.com>

	* tree-cfg.c (tree_merge_blocks): Release SSA_NAME phi results
	whose definitions are deleted due to basic block merging.

==== //depot2/gcctools/google_vendor_src_branch/gcc/trunk/gcc/tree-cfg.c#11 - /home/jimbob/clients/jimbob-perforce2-test/gcctools/google_vendor_src_branch/gcc/trunk/gcc/tree-cfg.c ====
# action=edit type=text
--- gcctools/google_vendor_src_branch/gcc/trunk/gcc/tree-cfg.c	2006-12-29 11:28:35.000000000 -0800
+++ gcctools/google_vendor_src_branch/gcc/trunk/gcc/tree-cfg.c	2006-12-28 13:49:43.000000000 -0800
@@ -1342,11 +1342,13 @@
 	  copy = build2_gimple (GIMPLE_MODIFY_STMT, def, use);
 	  bsi_insert_after (&bsi, copy, BSI_NEW_STMT);
 	  SSA_NAME_DEF_STMT (def) = copy;
+          remove_phi_node (phi, NULL, false);
 	}
       else
-	replace_uses_by (def, use);
-
-      remove_phi_node (phi, NULL, false);
+        {
+          replace_uses_by (def, use);
+          remove_phi_node (phi, NULL, true);
+        }
     }
 
   /* Ensure that B follows A.  */


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