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


>>>>> "Alexandre" == Alexandre Oliva <aoliva@redhat.com> writes:

Alexandre> Probably just because division by zero in C invokes
Alexandre> undefined behavior, so it's more efficient to optimize for
Alexandre> the well-defined behavior and leave undefined cases
Alexandre> undefined.

In theory we enable code in gcc that disables this sort of thing.

Alexandre>  Java probably needs some different implementation that
Alexandre> actually checks for a zero-valued dividend and throws an
Alexandre> exception.

We do this on platforms where the runtime behavior of the divide isn't
what we want.

If necessary we can enable this on x86.  It is a simple change in
libjava/configure.host.  However I'd like to verify the problem for
myself first...

Tom


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