https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94708
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:cbd2a10dd9edadb262934aed64c0959339da68d1 commit r10-7941-gcbd2a10dd9edadb262934aed64c0959339da68d1 Author: Haijian Zhang <z.zhanghaij...@huawei.com> Date: Fri Apr 24 08:56:25 2020 +0800 rtl combine should consider NaNs when generate fp min/max [PR94708] As discussed on PR94708, it's unsafe for rtl combine to generate fp min/max under -funsafe-math-optimizations, considering NaNs. In addition to flag_unsafe_math_optimizations check, we also need to do extra mode feature testing here: && !HONOR_NANS (mode) && !HONOR_SIGNED_ZEROS (mode) 2020-04-24 Haijian Zhang <z.zhanghaij...@huawei.com> gcc/ PR rtl-optimization/94708 * combine.c (simplify_if_then_else): Add check for !HONOR_NANS (mode) && !HONOR_SIGNED_ZEROS (mode). gcc/testsuite/ PR fortran/94708 * gfortran.dg/pr94708.f90: New test.