https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124142
Tamar Christina <tnfchris at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
--- Comment #3 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
We don't specifically check, since we float out the comparison out of the
condition and expect the existing vectorizable_operation to handle it.
That said:
(In reply to jchrist from comment #0)
> Created attachment 63703 [details]
> Reproducer
>
> I also tried this on aarch64 (see https://godbolt.org/z/eaqoE9s4x) where it
> looks like a division by 0 is possible, but SVE does not trap in that case.
SVE is architecturally defined not to trap on integer divide by zero
https://developer.arm.com/documentation/ddi0602/2025-12/SVE-Instructions/SDIV--Signed-divide--predicated--
So for SVE this is safe.
We rely on gimple_could_trap_p to tell us the operation could trap.
Mine then.