This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: combine: division by zero
Richard Henderson writes:
> On Thu, Jun 14, 2001 at 09:05:39PM +0100, Andrew Haley wrote:
> > While this may be acceptable for C, it isn't for some other languages
> > (certainly Java, perhaps also Ada) and the insn should be retained so
> > that it can trigger a divide overflow signal at run time.
>
> For C, division by zero is undefined, so technically we
> can do anything. Silently discarding the division doesn't
> seem like the most useful "anything" we could be doing.
>
> > * combine.c (nonzero_bits): Don't optimize away division by zero.
>
> Ok for mainline. Branch-wise, I imagine Mark will want
> this to wait for 3.0.1.
We have a good enough workaround for 3.0 already.
Thanks,
Andrew.