This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Test Failures (Was Re: [ecj] Patch: FYI: document --enable-java-maintainer-mode)
- From: Tom Tromey <tromey at redhat dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: Gary Benson <gbenson at redhat dot com>, Java Patch List <java at gcc dot gnu dot org>
- Date: 21 Dec 2006 09:21:49 -0700
- Subject: Re: Test Failures (Was Re: [ecj] Patch: FYI: document --enable-java-maintainer-mode)
- References: <m3ac1jrcak.fsf@localhost.localdomain> <20061220134531.GA3799@redhat.com> <m3ejqupjss.fsf@localhost.localdomain> <17802.52690.650742.614873@zebedee.pink>
- Reply-to: tromey at redhat dot com
>>>>> "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