Add gate function for PTA

Diego Novillo dnovillo@redhat.com
Thu Aug 26 20:53:00 GMT 2004


Prevents the .pta files from being created when not running andersen. 
Daniel wrote the patch.  Bootstrapped on x86 (C only).  Tested with
-fdump-tree-all-vops.


Diego.

2004-08-26  Daniel Berlin  <dberlin@dberlin.org>

	* tree-alias-common.c (gate_pta): New function.
	(pass_build_pta): Use it.
	(pass_del_pta): Use it.
	(delete_alias_vars): Don't check flag_tree_points_to.

Index: tree-alias-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-alias-common.c,v
retrieving revision 2.8
diff -u -3 -p -u -p -r2.8 tree-alias-common.c
--- tree-alias-common.c	23 Jul 2004 22:37:22 -0000	2.8
+++ tree-alias-common.c	26 Aug 2004 17:25:45 -0000
@@ -1029,10 +1029,20 @@ create_alias_vars (void)
   pta_global_var = NULL_TREE;
 }
 
+static bool
+gate_pta (void)
+{
+#ifdef HAVE_BANSHEE
+  return flag_tree_points_to != PTA_NONE;
+#else
+  return false;
+#endif
+}
+
 struct tree_opt_pass pass_build_pta = 
 {
   "pta",				/* name */
-  NULL,					/* gate */
+  gate_pta,				/* gate */
   create_alias_vars,			/* execute */
   NULL,					/* sub */
   NULL,					/* next */
@@ -1053,9 +1063,6 @@ delete_alias_vars (void)
 {
   size_t i;
 
-  if (flag_tree_points_to != PTA_ANDERSEN)
-    return;
-
   for (i = 0; i < VARRAY_ACTIVE_SIZE (local_alias_vars); i++)
     {
       tree key = VARRAY_TREE (local_alias_vars, i);
@@ -1080,7 +1087,7 @@ delete_alias_vars (void)
 struct tree_opt_pass pass_del_pta = 
 {
   "pta",				/* name */
-  NULL,					/* gate */
+  gate_pta,				/* gate */
   delete_alias_vars,			/* execute */
   NULL,					/* sub */
   NULL,					/* next */



More information about the Gcc-patches mailing list