https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61441
--- Comment #4 from Sujoy <ssaraswati at gmail dot com> --- Yes, I agree to your comment. With -fno-signaling-nans (which is the default), we need to fix the ccp so that the sNaN is converted to qNaN when the value is propagated. With -fsignaling-nans, we need to ensure that we disable the folding since it reduces the number of exceptions visible with sNaNs. I notice that even if I disable ccp, other optimizations like dead code elimination with cddce also needs to be disabled. Let me know if you agree.