[Bug middle-end/103406] [12 Regression] gcc -O0 behaves differently on "DBL_MAX related operations" than gcc -O1 and above
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Nov 25 19:04:05 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103406
--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Roger Sayle <sayle@gcc.gnu.org>:
https://gcc.gnu.org/g:6ea5fb3cc7f3cc9b731d72183c66c23543876f5a
commit r12-5529-g6ea5fb3cc7f3cc9b731d72183c66c23543876f5a
Author: Roger Sayle <roger@nextmovesoftware.com>
Date: Thu Nov 25 19:02:06 2021 +0000
PR middle-end/103406: Check for Inf before simplifying x-x.
This is a simple one line fix to the regression PR middle-end/103406,
where x - x is being folded to 0.0 even when x is +Inf or -Inf.
In GCC 11 and previously, we'd check whether the type honored NaNs
(which implicitly covered the case where the type honors infinities),
but my patch to test whether the operand could potentially be NaN
failed to also check whether the operand could potentially be Inf.
2021-11-25 Roger Sayle <roger@nextmovesoftware.com>
gcc/ChangeLog
PR middle-end/103406
* match.pd (minus @0 @0): Check tree_expr_maybe_infinite_p.
gcc/testsuite/ChangeLog
PR middle-end/103406
* gcc.dg/pr103406.c: New test case.
More information about the Gcc-bugs
mailing list