https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107071
--- Comment #6 from Richard Earnshaw <rearnsha at gcc dot gnu.org> --- Whilst the patch is probably fine and a better way of doing this, it won't fix the test failure. I think your problem is that you're assuming that an exception will cause a trap in hardware. That's not how IEEE says FP exceptions have to work. On aarch64, for most implementations the exceptions are accumulated in a status register and you have to read that register to see if an FP exception occurred.