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]

[PATCH] Java: prevent ICE for --with-gc=simple


Antonio Ake pointed out that gcj ICEs if configured with --with-gc=simple.

Using ggc_mark_tree in BUILD_FILENAME_IDENTIFIER_NODE looks wrong; it
should fail when called outside of a collection, though page GC seems to
ignore it.  (The identifier node should be registered through parse_roots;
I'm not sure why this patch was needed and unfortunately the original
message is lost in the archives.)

Bootstrapped on the trunk with both simple and page GC.  OK to commit?

2001-07-30  Jeff Sturm  <jsturm@one-point.com>

	* java-tree.h (BUILD_FILENAME_IDENTIFIER_NODE):
	Use ggc_add_tree_root to register roots.

Index: java-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/java-tree.h,v
retrieving revision 1.115
diff -u -r1.115 java-tree.h
--- java-tree.h	2001/07/06 04:31:03	1.115
+++ java-tree.h	2001/07/31 02:42:51
@@ -1459,7 +1459,7 @@
   if (!((F) = maybe_get_identifier ((S))))	\
     {						\
       (F) = get_identifier ((S));		\
-      ggc_mark_tree ((F));			\
+      ggc_add_tree_root (&(F), 1);		\
     }
 
 /* Add a FIELD_DECL to RECORD_TYPE RTYPE.


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