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]

[gc-improv] Revert yesterday's changes to tree-ssa-structalias.c


See thread http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00005.html why.
The correct patch has completed testing, I will commit it in a moment.

2009-11-02  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	Revert:
        2009-11-01  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
	* tree-ssa-structalias.c (heapvar_for_stmt): Remove GTY marker.
	(heapvar_map_obstack): New variable.
	(struct heapvar_map): Remove GTY marker.
	(heapvar_insert): Use obstack allocation.
	(get_constraint_for_1): Remove duplicated prototype.
	(heapvar_htab_alloc): New function.
	(init_alias_heapvars): Initialize heapvar_map_obstack.  Use it for
	heapvar_for_stmt element allocation.
	(delete_alias_heapvars): Free heapvar_map_obstack.
	(gt-tree-ssa-structalias.h): Remove include.
	* Makefile.in (tree-ssa-structalias.o): Remove
	gt-tree-ssa-structalias.h dependency.
	(GTFILES): Remove gt-tree-ssa-structalias.h

-- 
Laurynas
Index: ChangeLog.gc-improv
===================================================================
--- ChangeLog.gc-improv	(revision 153800)
+++ ChangeLog.gc-improv	(working copy)
@@ -1,3 +1,21 @@
+2009-11-02  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
+
+	Revert:
+        2009-11-01  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
+	* tree-ssa-structalias.c (heapvar_for_stmt): Remove GTY marker.
+	(heapvar_map_obstack): New variable.
+	(struct heapvar_map): Remove GTY marker.
+	(heapvar_insert): Use obstack allocation.
+	(get_constraint_for_1): Remove duplicated prototype.
+	(heapvar_htab_alloc): New function.
+	(init_alias_heapvars): Initialize heapvar_map_obstack.  Use it for
+	heapvar_for_stmt element allocation.
+	(delete_alias_heapvars): Free heapvar_map_obstack.
+	(gt-tree-ssa-structalias.h): Remove include.
+	* Makefile.in (tree-ssa-structalias.o): Remove
+	gt-tree-ssa-structalias.h dependency.
+	(GTFILES): Remove gt-tree-ssa-structalias.h
+
 2009-11-01  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
 
 	* tree-ssa-structalias.c (heapvar_for_stmt): Remove GTY marker.
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 153800)
+++ Makefile.in	(working copy)
@@ -2268,7 +2268,7 @@
    $(DIAGNOSTIC_H) $(TOPLEV_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) varray.h \
    $(GIMPLE_H) $(HASHTAB_H) $(FUNCTION_H) $(CGRAPH_H) \
    $(TREE_PASS_H) $(TIMEVAR_H) alloc-pool.h $(SPLAY_TREE_H) $(PARAMS_H) \
-   $(CGRAPH_H) $(ALIAS_H) pointer-set.h
+   gt-tree-ssa-structalias.h $(CGRAPH_H) $(ALIAS_H) pointer-set.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 \
@@ -3584,6 +3584,7 @@
   $(srcdir)/tree-ssa-propagate.c \
   $(srcdir)/tree-phinodes.c \
   $(srcdir)/ipa-reference.c \
+  $(srcdir)/tree-ssa-structalias.c \
   $(srcdir)/lto-symtab.c \
   $(srcdir)/tree-ssa-alias.h \
   $(srcdir)/ipa-prop.h \
@@ -4525,7 +4526,7 @@
 # Install lto-wrapper.
 install-lto-wrapper: lto-wrapper$(exeext)
 	$(INSTALL_PROGRAM) lto-wrapper$(exeext) $(DESTDIR)$(libexecsubdir)/lto-wrapper$(exeext)
-
+	
 # Cancel installation by deleting the installed files.
 uninstall: lang.uninstall
 	-rm -rf $(DESTDIR)$(libsubdir)
Index: tree-ssa-structalias.c
===================================================================
--- tree-ssa-structalias.c	(revision 153800)
+++ tree-ssa-structalias.c	(working copy)
@@ -160,7 +160,8 @@
   TODO: We could handle unions, but to be honest, it's probably not
   worth the pain or slowdown.  */
 
-static htab_t heapvar_for_stmt;
+static GTY ((if_marked ("tree_map_marked_p"), param_is (struct tree_map)))
+htab_t heapvar_for_stmt;
 
 static bool use_field_sensitive = true;
 static int in_ipa_mode = 0;
@@ -289,9 +290,7 @@
        escaped_id = 3, nonlocal_id = 4, callused_id = 5,
        storedanything_id = 6, integer_id = 7 };
 
-static struct obstack heapvar_map_obstack;
-
-struct heapvar_map {
+struct GTY(()) heapvar_map {
   struct tree_map map;
   unsigned HOST_WIDE_INT offset;
 };
@@ -336,8 +335,7 @@
   struct heapvar_map *h;
   void **loc;
 
-  h = (struct heapvar_map *)obstack_alloc (&heapvar_map_obstack,
-					   sizeof (struct heapvar_map));
+  h = GGC_NEW (struct heapvar_map);
   h->map.base.from = from;
   h->offset = offset;
   h->map.hash = heapvar_map_hash (h);
@@ -3089,6 +3087,8 @@
     }
 }
 
+static void get_constraint_for_1 (tree, VEC (ce_s, heap) **, bool);
+
 /* Given a tree T, return the constraint expression for taking the
    address of it.  */
 
@@ -5379,26 +5379,14 @@
   bitmap_obstack_release (&predbitmap_obstack);
 }
 
-static void *
-heapvar_htab_alloc (size_t c, size_t n)
-{
-  void * result = obstack_alloc (&heapvar_map_obstack, c * n);
-  memset (result, 0, c * n);
-  return result;
-}
-
 /* Initialize the heapvar for statement mapping.  */
 
 static void
 init_alias_heapvars (void)
 {
   if (!heapvar_for_stmt)
-    {
-      obstack_init (&heapvar_map_obstack);
-      heapvar_for_stmt = htab_create_alloc (11, tree_map_hash, heapvar_map_eq,
-					    NULL, heapvar_htab_alloc,
-					    NULL);
-    }
+    heapvar_for_stmt = htab_create_ggc (11, tree_map_hash, heapvar_map_eq,
+					NULL);
 }
 
 /* Delete the heapvar for statement mapping.  */
@@ -5407,10 +5395,7 @@
 delete_alias_heapvars (void)
 {
   if (heapvar_for_stmt)
-    {
-      htab_delete (heapvar_for_stmt);
-      obstack_free (&heapvar_map_obstack, NULL);
-    }
+    htab_delete (heapvar_for_stmt);
   heapvar_for_stmt = NULL;
 }
 
@@ -5789,3 +5774,6 @@
   TODO_update_ssa                       /* todo_flags_finish */
  }
 };
+
+
+#include "gt-tree-ssa-structalias.h"

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