This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFC: With -fnon-call-exceptions don't eliminate division by zero
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 11 Oct 2010 14:21:35 -0700
- Subject: Re: PATCH RFC: With -fnon-call-exceptions don't eliminate division by zero
- References: <mcrhbgswhuk.fsf@google.com>
On Mon, Oct 11, 2010 at 2:16 PM, Ian Lance Taylor <iant@google.com> wrote:
> The -fnon-call-exceptions options indicates that certain operations,
> including division by zero, should generate an exception. ÂThis includes
> cases like 0 / 0. ÂThis patch ensures that 0 / 0 and any other division
> by zero is not eliminated when -fnon-call-exceptions is used. ÂThis
> includes a test case which fails without the patch and passes with the
> patch.
>
> This patch is entirely in the middle-end so I don't require approval.
> However, I would like to see if there are any comments before I commit
> this. ÂThanks.
The testcase will never work on powerpc or spu or any other target
where dividing by zero does not cause an exception to happen. (MIPS
does a specific check for 0 and causes a trap).
Not to mention I think on those targets we should remove the divide by
zero still as they did not cause an exception to happen.
Thanks,
Andrew Pinski