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]

Re: Divide by zero does not throw exception for longs



Aneesh Aggarwal writes:

> I have filed a bug-report, the identification is java/3097. I
> thought I'll mention it here so that it gets some attention and if
> the bug is present in the 3.0 release, it might be fixed.

One work around is to use -fuse-divide-subroutine. Are they any
options, I don't know. But it should solve your problem for now:

  apbianco@venonat[~/support/net/PRs/3097]: gcj div_test_long.java --main=div_test_long     
  apbianco@venonat[~/support/net/PRs/3097]: ./a.out 
  Exception in thread "main" java.lang.ArithmeticException: / by zero
   at 0x4014965c: _Jv_ThrowSignal (/home/apbianco/install/gcc-3.0/install-x86/lib/libgcj.so.2)
   at 0x401496f1: _Jv_ThrowSignal (/home/apbianco/install/gcc-3.0/install-x86/lib/libgcj.so.2)
   at 0x08048b55: div_test_long.main(java.lang.String[]) (/home/apbianco/support/net/PRs/3097/div_test_long.java:5)
   at 0x401601a7: gnu.gcj.runtime.FirstThread.run() (/home/apbianco/install/gcc-3.0/install-x86/lib/libgcj.so.2)
   at 0x4016afe2: java.lang.Thread.run_(java.lang.Object) (/home/apbianco/install/gcc-3.0/install-x86/lib/libgcj.so.2)
   at 0x40277f45: _Jv_ThreadSetPriority(_Jv_Thread_t, int) (/home/apbianco/install/gcc-3.0/install-x86/lib/libgcj.so.2)
   at 0x4049e6bc: GC_start_routine (/home/apbianco/install/gcc-3.0/install-x86/lib/libgcjgc.so.1)
   at 0x404b795d: pthread_detach (/lib/libpthread.so.0)
   at 0x405b6f1a: __clone (/lib/libc.so.6)

  apbianco@venonat[~/support/net/PRs/3097]: gcj div_test_long.java --main=div_test_long -fuse-divide-subroutine
  apbianco@venonat[~/support/net/PRs/3097]: ./a.out 
  Div by zero working
 
I'll update the PR with the work around.

./A


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