public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCHx2,java] Fix java tree checking assert and
@ 2010-12-11 11:46 Dave Korn
  2010-12-11 13:35 ` ... and tree ssa loop prefetch pass bad gimple creation, I meant to say... [was [PATCHx2,java] Fix java tree checking assert and] Dave Korn
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Korn @ 2010-12-11 11:46 UTC (permalink / raw)
  To: Java Patches, GCC Patches

[-- Attachment #1: Type: text/plain, Size: 1678 bytes --]


    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


[-- Attachment #2: java-tree-dump-checking-fix.diff --]
[-- Type: text/x-c, Size: 609 bytes --]

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);
 	    }

[-- Attachment #3: java-loop-prefetch-crash-fix.diff --]
[-- Type: text/x-c, Size: 542 bytes --]

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);
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* ... and tree ssa loop prefetch pass bad gimple creation, I meant to say...  [was [PATCHx2,java] Fix java tree checking assert and]
  2010-12-11 11:46 [PATCHx2,java] Fix java tree checking assert and Dave Korn
@ 2010-12-11 13:35 ` Dave Korn
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Korn @ 2010-12-11 13:35 UTC (permalink / raw)
  To: Java Patches, GCC Patches

ibid.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-11 13:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-11 11:46 [PATCHx2,java] Fix java tree checking assert and Dave Korn
2010-12-11 13:35 ` ... and tree ssa loop prefetch pass bad gimple creation, I meant to say... [was [PATCHx2,java] Fix java tree checking assert and] Dave Korn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).