https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110335
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Another testcase: ``` void h3(int to) { double dto = to; double damt = dto +2; if (damt != damt) __builtin_trap(); } ``` Note we do optimize: ``` void done(int to) { double dto = to; double damt = -dto; if (damt != damt) __builtin_trap(); } ``` But via match and simplify. Note there is tree_expr_maybe_nan_p and tree_expr_finite_p in fold-const.cc Which can be used as a model for some frange related things too.