[PATCH,java] fix PR 44103, libjava testsuite failures

Nathan Froyd froydnj@codesourcery.com
Thu May 13 14:50:00 GMT 2010


The patch below addresses the problem described here:

http://gcc.gnu.org/ml/gcc-patches/2010-05/msg00913.html

by marking the new constructor non-constant in
FINISH_RECORD_CONSTRUCTOR.

It would have been nice to add CONSTRUCTOR verification to
tree-cfg.c:verify_gimple_assign_single, but doing so causes bootstrap
failures.  I'll look at that later.

Tested on x86_64-linux.  OK?

-Nathan

	PR 44103
	* java-tree.h (FINISH_RECORD_CONSTRUCTOR): Set TREE_CONSTANT on CONS.

Index: java-tree.h
===================================================================
--- java-tree.h	(revision 159339)
+++ java-tree.h	(working copy)
@@ -1504,7 +1504,12 @@ extern tree *type_map;
 
 /* Finish creating a record CONSTRUCTOR CONS. */
 #define FINISH_RECORD_CONSTRUCTOR(CONS) \
-  VEC_pop (constructor_elt, CONSTRUCTOR_ELTS (CONS))
+  do \
+    { \
+      TREE_CONSTANT (CONS) = 0; \
+      VEC_pop (constructor_elt, CONSTRUCTOR_ELTS (CONS)); \
+    } \
+  while (0)
 
 #define BLOCK_EXPR_DECLS(NODE)  BLOCK_VARS(NODE)
 #define BLOCK_EXPR_BODY(NODE)   BLOCK_SUBBLOCKS(NODE)



More information about the Gcc-patches mailing list