On Fri, 15 Oct 2021, Richard Biener via Gcc-patches wrote: > On Fri, Sep 24, 2021 at 2:59 PM Jirui Wu via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: > > > > Hi, > > > > Ping: https://gcc.gnu.org/pipermail/gcc-patches/2021-August/577846.html > > > > The patch is attached as text for ease of use. Is there anything that needs > > to change? > > > > Ok for master? If OK, can it be committed for me, I have no commit rights. > > I'm still not sure about the correctness. I suppose the > flag_fp_int_builtin_inexact && !flag_trapping_math is supposed to guard > against spurious inexact exceptions, shouldn't that be > !flag_fp_int_builtin_inexact || !flag_trapping_math instead?
The following remarks may be relevant here, but are not intended as an assertion of what is correct in this case. 1. flag_fp_int_builtin_inexact is the more permissive case ("inexact" may or may not be raised). All existing uses in back ends are "flag_fp_int_builtin_inexact || !flag_trapping_math" or equivalent. 2. flag_fp_int_builtin_inexact only applies to certain built-in functions (as listed in invoke.texi). It's always unspecified, even in C2X, whether casts of non-integer values from floating-point to integer types raise "inexact". So flag_fp_int_builtin_inexact should not be checked in insn patterns corresponding to simple casts from floating-point to integer, only in insn patterns corresponding to the built-in functions listed for -fno-fp-int-builtin-inexact in invoke.texi (or for operations that combine such a built-in function with a cast of the *result* to integer type). -- Joseph S. Myers jos...@codesourcery.com