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]
Other format: [Raw text]

Re: PATCH RFC: With -fnon-call-exceptions don't eliminate division by zero


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


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