On Fri, 21 Jun 2024, YunQiang Su wrote:
> > Then GCC emits the wrong trap instruction, wherever it comes from and
> > whatever has caused it. The correct ones for integer division by zero
>
> Thanks so much. It is not the bug of Linux kernel or GCC.
> It is a bug of me ;) and qemu.
>
> Qemu di
>
> Then GCC emits the wrong trap instruction, wherever it comes from and
> whatever has caused it. The correct ones for integer division by zero
Thanks so much. It is not the bug of Linux kernel or GCC.
It is a bug of me ;) and qemu.
Qemu didn't pass the code of TEQ correctly; and I haven't ru
On Thu, 20 Jun 2024, Richard Biener wrote:
> > > The DIV instructions of MIPS won't be trapped themself if the divisor
> > > is zero. The compiler will emit a conditional trap instruct for it.
> > > So the signal will be SIGTRAP instead of SIGFPE.
> >
> > It's an OS kernel bug if you get SIGTRAP
On Thu, Jun 20, 2024 at 12:57 PM Maciej W. Rozycki wrote:
>
> On Thu, 20 Jun 2024, YunQiang Su wrote:
>
> > The DIV instructions of MIPS won't be trapped themself if the divisor
> > is zero. The compiler will emit a conditional trap instruct for it.
> > So the signal will be SIGTRAP instead of SI
On Thu, 20 Jun 2024, YunQiang Su wrote:
> The DIV instructions of MIPS won't be trapped themself if the divisor
> is zero. The compiler will emit a conditional trap instruct for it.
> So the signal will be SIGTRAP instead of SIGFPE.
It's an OS kernel bug if you get SIGTRAP for integer division
The DIV instructions of MIPS won't be trapped themself if the divisor
is zero. The compiler will emit a conditional trap instruct for it.
So the signal will be SIGTRAP instead of SIGFPE.
gcc/testsuite
* c-c++-common/ubsan/overflow-div-3.c: Use SIGTRAP for MIPS.
---
gcc/testsuite/c-c++-co