[PATCH] PR rtl-optimization 61494: Preserve x-0.0 with HONOR_SNANS.

Roger Sayle roger@nextmovesoftware.com
Sun Aug 2 10:00:15 GMT 2020


The following patch avoids simplifying x-0.0 to x when -fsignaling-nans is
specified,
which resolves PR rtl-optimization 61494.  Indeed, running the test program
attached
to that PR now reports no failures.  Alas reducing that validation program
to a portable
test for the GCC testsuite is a challenge that I plan to leave to a
volunteer.  The fix 
itself is a trivial one-liner, so it's curious that the compiler has been
broken for so long.
Hopefully folks agree that correctness is more important than testability
(but both
are desirable).

The following patch has been tested on x86_64-pc-linux-gnu with a "make
bootstrap"
and "make -k check" with no new regressions.
Ok for mainline?

2020-08-02  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
	PR rtl-optimization/61494
	* simplify-rtx.c (simplify_binary_operation_1) [MINUS]: Don't
	simplify x - 0.0 with -fsignaling-nans.

Thanks in advance,
Roger
--
Roger Sayle
NextMove Software
Cambridge, UK

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patchq.txt
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200802/9123f875/attachment.txt>


More information about the Gcc-patches mailing list