On Mon, Aug 29, 2022 at 4:30 PM Toon Moene <t...@moene.org> wrote: > > On 8/29/22 16:15, Aldy Hernandez wrote: > > > But even with -ffinite-math-only, is there any benefit to propagating > > a known NAN? For example: > > The original intent (in 2002) for the option -ffinite-math-only was for > the optimizers to ignore all the various exceptions to common > optimizations because they might not work correctly when presented with > a NaN or an Inf. > > I do not know what the effect for floating point range information would > be - offhand. > > But in the *spirit* of this option would be to ignore that the range > [5.0, 5.0] would "also" contain NaN, for instance.
Hmm, this is somewhat similar to what Jakub suggested. Perhaps we could categorically set !NAN for !HONOR_NANS at frange construction time? For reference: bool HONOR_NANS (machine_mode m) { return MODE_HAS_NANS (m) && !flag_finite_math_only; } Thanks. Aldy