https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82319
--- Comment #4 from Yury Gribov <ygribov at gcc dot gnu.org> --- (In reply to Richard Biener from comment #3) > Testing the following to match comments. Thanks, so the assertion proved to be useful in the end. I'd rather change cst_int_p to be bool cst_int_p = real_identical (&icst, cst) && ! real_isnan (cst); and then maybe add a special case for nan case when expanding the pattern. I'll take a look in the evening and hopefully send a patch tomorrow if that's fine?