This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: combine: division by zero
- To: Andrew Haley <aph at cambridge dot redhat dot com>
- Subject: Re: combine: division by zero
- From: Richard Henderson <rth at redhat dot com>
- Date: Thu, 14 Jun 2001 13:37:19 -0700
- Cc: gcc-patches at gcc dot gnu dot org
- References: <15145.6419.49796.470046@cuddles.cambridge.redhat.com>
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.
r~