This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: combine: division by zero


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~


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