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. > >