https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106805
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- So, the current state is that this is now optimized away by dom2 using frange, like in PR107608 (which is closed with a workaround), but in this case the NaN vs. 1.0 or NaN vs. Inf >= and <= comparisons get a singleton integral range which dom2 then optimizes out. GCC 12 optimizes it out currently even earlier because #c5 change isn't backported there yet, but otherwise wouldn't suffer from the frange issue and would be miscompiled only during expansion. I'd say for now if you want such a function to raise exceptions even with constant arguments, don't make it inline and add noipa attribute to it instead. That case I think has been fixed on the trunk already.