xscale-elf testsuite results

Tom Tromey tromey@redhat.com
Fri Mar 22 10:31:00 GMT 2002


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

Anthony> I had no problem building an xscale-elf toolchain with this
Anthony> flag.  Did you try that?

Andrew> No.

It only worked for AG due to the spec file build bug.  It definitely
won't work in general, since the bug is not platform-dependent.

I came up with this patch.  It does work.  I probably need at least a
comment explaining what is going on.

I think this solves the problem because the `final' errors can only
occur when modifying a field of `this'.  And this patch works by
disabling checking if we're doing that.  This is based on the theory
that we never need a test to see if `this' is non-null.  But is that
theory accurate?  What if we're in a final non-static method?
Actually, in that case I think the caller checks.  At least according
to parse.y.  So I think this is safe.

Comments?  Anthony, could you try a full xscale-elf rebuild with this?
Andrew, Alex, do you think there is a better way to approach this
problem?

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* expr.c (build_field_ref): Don't build a check if the field is a
	member of `this'.

Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/expr.c,v
retrieving revision 1.132.2.4
diff -u -r1.132.2.4 expr.c
--- expr.c 2002/03/11 11:25:48 1.132.2.4
+++ expr.c 2002/03/22 18:25:59
@@ -1586,6 +1586,9 @@
     }
   else
     {
+      int check = (flag_check_references
+		   && DECL_NAME (self_value) != this_identifier_node);
+
       tree base_handle_type = promote_type (base_class);
       if (base_handle_type != TREE_TYPE (self_value))
 	self_value = fold (build1 (NOP_EXPR, base_handle_type, self_value));
@@ -1593,7 +1596,7 @@
       self_value = unhand_expr (self_value);
 #endif
       self_value = build_java_indirect_ref (TREE_TYPE (TREE_TYPE (self_value)),
-					    self_value, flag_check_references);
+					    self_value, check);
       return fold (build (COMPONENT_REF, TREE_TYPE (field_decl),
 			  self_value, field_decl));
     }



More information about the Java mailing list