re PR java/25535 (gcj broken on 64-bit big-endian systems)
authorAndrew Haley <aph@redhat.com>
Tue, 7 Feb 2006 19:02:39 +0000 (19:02 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Tue, 7 Feb 2006 19:02:39 +0000 (19:02 +0000)
2006-02-07  Andrew Haley  <aph@redhat.com>

        * expr.c (expand_invoke): (BC mode.)  If we find a method in a
        class other than the one in which we expected to find it, ignore
        the result.

        PR java/25535
        * constants.c (build_constants_constructor): move initializer into
        first halfword on a 6-bit big-endian machine.

From-SVN: r110710

gcc/java/ChangeLog
gcc/java/constants.c
gcc/java/expr.c

index 5d2515ace3f1f101c2a5267263405ac8a8230497..bc5a579d213c838c1db41f8424acb34c7f9d645e 100644 (file)
@@ -1,3 +1,13 @@
+2006-02-07  Andrew Haley  <aph@redhat.com>
+
+       * expr.c (expand_invoke): (BC mode.)  If we find a method in a
+       class other than the one in which we expected to find it, ignore
+       the result.
+
+       PR java/25535
+       * constants.c (build_constants_constructor): move initializer into
+       first halfword on a 6-bit big-endian machine.
 2006-02-04  Tom Tromey  <tromey@redhat.com>
 
        PR java/25676:
index 98a05043e47b5b011e9b729cad693cc60f85ec5e..5d2f6785356afddc34cedffa58ae5bb7c73e991b 100644 (file)
@@ -1,5 +1,5 @@
 /* Handle the constant pool of the Java(TM) Virtual Machine.
-   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
+   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -480,7 +480,15 @@ build_constants_constructor (void)
       case CONSTANT_Fieldref:
       case CONSTANT_NameAndType:
        {
-         jword temp = outgoing_cpool->data[i].w;
+         unsigned HOST_WIDE_INT temp = outgoing_cpool->data[i].w;
+
+         /* Make sure that on a 64-bit big-endian machine this
+            32-bit jint appears in the first word.  
+            FIXME: This is a kludge.  The field we're initializing is
+            not a scalar but a union, and that's how we should
+            represent it in the compiler.  We should fix this.  */
+         if (BYTES_BIG_ENDIAN && BITS_PER_WORD > 32)
+           temp <<= BITS_PER_WORD - 32;
 
          tags_list
            = tree_cons (NULL_TREE, 
index 5e7699b87d8c8ed32e478e664055ed82286605c9..52f7e488b32fd005f6cd254fdd020a6921a4273b 100644 (file)
@@ -2271,6 +2271,17 @@ expand_invoke (int opcode, int method_ref_index, int nargs ATTRIBUTE_UNUSED)
   else
     method = lookup_java_method (self_type, method_name, method_signature);
 
+  /* We've found a method in a class other than the one in which it
+     was wanted.  This can happen if, for instance, we're trying to
+     compile invokespecial super.equals().  
+     FIXME: This is a kludge.  Rather than nullifying the result, we
+     should change lookup_java_method() so that it doesn't search the
+     superclass chain when we're BC-compiling.  */
+  if (! flag_verify_invocations
+      && method
+      && self_type != DECL_CONTEXT (method))
+    method = NULL_TREE;
+
   /* We've found a method in an interface, but this isn't an interface
      call.  */
   if (opcode != OPCODE_invokeinterface