This is the mail archive of the java@gcc.gnu.org mailing list for the Java 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]

Re: Test Failures (Was Re: [ecj] Patch: FYI: document --enable-java-maintainer-mode)


>>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:

Andrew> I have:

I have these too.

Andrew> FAIL: natshortfield.cc compilation
Andrew> FAIL: register2.c compilation

Test suite bugs.

Andrew> FAIL: PR162 output - source compiled test

This may not be a bug; I'm not sure.

Andrew> FAIL: Serialization execution - source compiled test

Haven't looked.

Andrew> I guess ArrayStore may be fixed by http://gcc.gnu.org/bugzilla/attachment.cgi?id=11712&action=view
Andrew> I think that makes it low-hanging fruit.  I'll try it now.

That patch had some problem as I recall.  I don't remember what.  I
have another variant kicking around (appended) but perhaps you'd be
better off just rewriting from scratch.  I don't remember what testing
the appended got, if any.

Tom

Index: expr.c
===================================================================
--- expr.c	(revision 114870)
+++ expr.c	(working copy)
@@ -1128,6 +1128,7 @@
 				 int_type_node : rhs_type_node);
   tree index = pop_value (int_type_node);
   tree array_type, array;
+  tree ref;
 
   /* If we're processing an `aaload' we might as well just pick
      `Object'.  */
@@ -1149,14 +1150,18 @@
   index = save_expr (index);
   array = save_expr (array);
 
+  ref = save_expr (build_java_arrayaccess (array, rhs_type_node, index));
   if (TREE_CODE (rhs_type_node) == POINTER_TYPE)
     {
-      tree check = build_java_arraystore_check (array, rhs_node);
-      java_add_stmt (check);
+      /* Ensure that the array bounds check is done before the store
+	 check.  */
+      tree ensure = build2 (COMPOUND_EXPR, TREE_TYPE (array),
+			    ref, array);
+      tree check = build_java_arraystore_check (ensure, rhs_node);
+      ref = build2 (COMPOUND_EXPR, TREE_TYPE (ref), check, ref);
     }
-  
-  array = build_java_arrayaccess (array, rhs_type_node, index);
-  java_add_stmt (build2 (MODIFY_EXPR, TREE_TYPE (array), array, rhs_node));  
+
+  java_add_stmt (build2 (MODIFY_EXPR, TREE_TYPE (ref), ref, rhs_node));  
 }
 
 /* Expand the evaluation of ARRAY[INDEX]. build_java_check_indexed_type makes 


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