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


On Jun 11, 2001, Alexandre Petit-Bianco <apbianco@cygnus.com> wrote:

> Alexandre Petit-Bianco writes:

>> 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:

> What I meant to say was: is there a good reason why on x86 __divdi3
> doesn't cooperate with EH (or vice-versa,) I don't know.

Probably just because division by zero in C invokes undefined
behavior, so it's more efficient to optimize for the well-defined
behavior and leave undefined cases undefined.  Java probably needs
some different implementation that actually checks for a zero-valued
dividend and throws an exception.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


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