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]

[PATCHx2,java] Fix java tree checking assert and


    Hello lists,


  The attached patches fix a couple of problems(*) exposed by the tree ssa
loop prefetch pass in recent trunk builds of jc1:

- loop prefetch generates an invalid gimple call to __builtin_prefetch(),
because it uses the integer_three_node global tree; because java doesn't take
advantage of the core build_common_tree_nodes_2() routine but sets up all the
nodes itself, this was missing any initialisation - integer_three_node is a
recent addition to the core, and the prefetch pass was adjusted to use it, but
java was inadvertently omitted.

- turning on tree dump can cause a crash when it tries to generate a name for
a nested function, because put_decl_node doesn't understand that the context
of a function_decl can be another function_decl.

  The first I fixed by adding the missing initialisation - long-term I guess
it would be better to see if java couldn't use build_common_tree_nodes_2() in
some way, but that's not stage3 material.  The second I fixed by making it
treat the nested function as just another level of scope, adding another
period-separated segment to the generated name.

java/ChangeLog:

	* decl.c (java_init_decl_processing): Initialise integer_three_node.
	* lang.c (put_decl_node): Handle nested function decls.

  I verified that this fixed the failing compile that I had seen in the
testsuite, now I'm taking the combined patchset for a full bootstrap and test
cycle on i686-pc-cygwin.  OK if that completes without regressions?

    cheers,
      DaveK
-- 
(*) - http://gcc.gnu.org/ml/gcc/2010-12/msg00308.html
      http://gcc.gnu.org/ml/gcc/2010-12/msg00315.html
      http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29710

Index: gcc/java/lang.c
===================================================================
--- gcc/java/lang.c	(revision 167688)
+++ gcc/java/lang.c	(working copy)
@@ -402,7 +402,9 @@ put_decl_node (tree node, int verbosity)
                  if verbosity is higher than 1.  */
               && verbosity >= 1)
 	    {
-	      put_decl_node (TYPE_NAME (DECL_CONTEXT (node)),
+	      put_decl_node (TREE_CODE (DECL_CONTEXT (node)) == FUNCTION_DECL
+			     ? DECL_CONTEXT (node)
+			     : TYPE_NAME (DECL_CONTEXT (node)),
                                verbosity);
 	      put_decl_string (".", 1);
 	    }
Index: gcc/java/decl.c
===================================================================
--- gcc/java/decl.c	(revision 167688)
+++ gcc/java/decl.c	(working copy)
@@ -614,6 +614,7 @@ java_init_decl_processing (void)
   integer_zero_node = build_int_cst (NULL_TREE, 0);
   integer_one_node = build_int_cst (NULL_TREE, 1);
   integer_two_node = build_int_cst (NULL_TREE, 2);
+  integer_three_node = build_int_cst (NULL_TREE, 3);
   integer_four_node = build_int_cst (NULL_TREE, 4);
   integer_minus_one_node = build_int_cst (NULL_TREE, -1);
 

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