From: Richard Biener <richard.guenther@gmail.com>
To: Stephen Smith <ischis2@cox.net>
Cc: gcc@gcc.gnu.org, binutils@sourceware.org
Subject: Re: Division by zero on A53 which does not raise an exception
Date: Tue, 29 Nov 2022 09:30:42 +0100 [thread overview]
Message-ID: <CAFiYyc08TmaGy4RzmWPbrzLp7KCdwEanC2CkMWEKv=PB+Q=hLw@mail.gmail.com> (raw)
In-Reply-To: <4789825.31r3eYUQgx@thunderbird>
On Tue, Nov 29, 2022 at 5:39 AM Stephen Smith via Gcc <gcc@gcc.gnu.org> wrote:
>
> I am working on a project which is using an A53 core. The core does not
> raise an exception if there is a division by zero (for either integer or
> floating point division).
>
> The designers chose to set status bits for the floating point case but not
> raise an exception. With the integer division no status bits are set.
>
> Does the GCC compilers or Binutils assembler and linker have a way to deal
> with this issue on the ARM A53 processor?
>
> For Linux, was special support added in the kernel to help Glibc with this
> issue? If so, I will comb the linux source tree.
>
> My project is using GCC 7.3.0
I'm second-guessing that you want to have an exception raised for
integer division by zero? Since the C standard defines this as
invoking undefined behavior and GCC generally takes advantage
of this reliably getting an exception is difficult. There's
-fsanitize=integer-divide-by-zero -fsanitize-undefined-trap-on-error
which you could use.
There are targets with options like -mcheck-zero-division but
arm is not amongst those.
Richard.
>
>
next prev parent reply other threads:[~2022-11-29 8:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-29 4:37 Stephen Smith
2022-11-29 8:30 ` Richard Biener [this message]
2022-11-29 12:00 ` Szabolcs Nagy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFiYyc08TmaGy4RzmWPbrzLp7KCdwEanC2CkMWEKv=PB+Q=hLw@mail.gmail.com' \
--to=richard.guenther@gmail.com \
--cc=binutils@sourceware.org \
--cc=gcc@gcc.gnu.org \
--cc=ischis2@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).