This is the mail archive of the java-patches@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: [PATCH/RFC] Enable java on sh64-linux (Take 2)


Tom Tromey <tromey@redhat.com> wrote:
> Kaz> I'd like to see the divide overflow handler.
> 
> The usual solution to this problem is to turn on
> -fuse-divide-subroutine in configure.host for your platform.  See,
> e.g., libjava/prims.cc:_Jv_divI() for what is supposed to happen.
> Divide_1 just tests all these cases.

I've noticed that -fuse-divide-subroutine is used already for this
target and found that a libffi problem of this target causes
the Divide_1 failure with gij.  SH-5 has 64-bit integer registers
and I've forgot to extend 32-bit signed integers to 64-bit signed
integers when storing them to 64-bit width memory in ffi_prep_args.
With fixing it, I've got

FAIL: ArrayStore execution - gij test
FAIL: ArrayStore execution - gij test
FAIL: FileHandleGcTest execution - gij test
FAIL: FileHandleGcTest execution - gij test
FAIL: LargeFile execution - source compiled test
FAIL: LargeFile execution - gij test
FAIL: LargeFile execution - bytecode->native test
FAIL: LargeFile -O3 execution - source compiled test
FAIL: LargeFile execution - gij test
FAIL: LargeFile -O3 execution - bytecode->native test
FAIL: PR3096 -O3 execution - source compiled test
FAIL: Process_2 output - source compiled test
FAIL: Process_2 output - gij test
FAIL: Process_2 output - bytecode->native test
FAIL: Process_2 -O3 output - source compiled test
FAIL: Process_2 output - gij test
FAIL: Process_2 -O3 output - bytecode->native test
FAIL: Thread_Wait_2 -O3 execution - source compiled test
FAIL: Thread_Wait_2 -O3 execution - bytecode->native test
FAIL: Thread_Wait_Interrupt -O3 execution - source compiled test
FAIL: Thread_Wait_Interrupt -O3 execution - bytecode->native test
FAIL: pr83 -O3 output - source compiled test
FAIL: pr83 -O3 output - bytecode->native test

Now I'm looking the ArrayStore gij failure.

BTW, it's surprising that no testcase could detect the above problem,
isn't it?  How about the testcase below?  It caught this mistake.

Regards,
	kaz
--
	* testsuite/libffi.call/negint.c: New test case.

diff -uprN ORIG/gcc/libffi/testsuite/libffi.call/negint.c LOCAL/gcc/libffi/testsuite/libffi.call/negint.c
--- ORIG/gcc/libffi/testsuite/libffi.call/negint.c	Thu Jan  1 09:00:00 1970
+++ LOCAL/gcc/libffi/testsuite/libffi.call/negint.c	Sat Oct  2 07:47:47 2004
@@ -0,0 +1,54 @@
+/* Area:	ffi_call
+   Purpose:	Check that negative integers are passed correctly.
+   Limitations:	none.
+   PR:		none.
+   Originator:	From the original ffitest.c  */
+
+/* { dg-do run } */
+/* { dg-options -O2 } */
+
+#include "ffitest.h"
+
+static int checking(int a, short b, signed char c)
+{
+  int i;
+
+  return (a < 0 && b < 0 && c < 0);
+}
+
+int main (void)
+{
+  ffi_cif cif;
+  ffi_type *args[MAX_ARGS];
+  void *values[MAX_ARGS];
+  ffi_arg rint;
+
+  signed int si;
+  signed short ss;
+  signed char sc;
+
+  args[0] = &ffi_type_sint;
+  values[0] = &si;
+  args[1] = &ffi_type_sshort;
+  values[1] = &ss;
+  args[2] = &ffi_type_schar;
+  values[2] = &sc;
+
+  /* Initialize the cif */
+  CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
+		     &ffi_type_sint, args) == FFI_OK);
+
+  si = -6;
+  ss = -12;
+  sc = -1;
+
+  checking (si, ss, sc);
+
+  ffi_call(&cif, FFI_FN(checking), &rint, values);
+
+  printf ("%d vs %d\n", (int)rint, checking (si, ss, sc));
+
+  CHECK(rint != 0);
+
+  exit (0);
+}


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