rtl combine should consider NaNs when generate fp min/max [PR94708]
authorHaijian Zhang <z.zhanghaijian@huawei.com>
Fri, 24 Apr 2020 00:56:25 +0000 (08:56 +0800)
committerRichard Biener <rguenther@suse.de>
Fri, 24 Apr 2020 09:25:38 +0000 (11:25 +0200)
commitcbd2a10dd9edadb262934aed64c0959339da68d1
tree7907278cac6c08c1adff8e654207b05d24dc7fd8
parent6f6c79920883f3fc301a4acc0544ed5a130bf7c5
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.zhanghaijian@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.
gcc/ChangeLog
gcc/combine.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr94708.f90 [new file with mode: 0644]