Divide by zero does not throw exception for longs

Alexandre Oliva aoliva@redhat.com
Tue Jun 12 16:47:00 GMT 2001


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


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /