Go to file
Roger Sayle 72c243017d PR middle-end/98420: Don't fold x - x to 0.0 with -frounding-math
This patch addresses PR middle-end/98420, which is inappropriate constant
folding of x - x to 0.0 (in match.pd) when -frounding-math is specified.
Specifically, x - x may be -0.0 with FE_DOWNWARD as the rounding mode.

To summarize, the desired IEEE behaviour, x - x for floating point x,
(1) can't be folded to 0.0 by default, due to the possibility of NaN or Inf
(2) can be folded to 0.0 with -ffinite-math-only
(3) can't be folded to 0.0 with -ffinite-math-only -frounding-math
(4) can be folded with -ffinite-math-only -frounding-math -fno-signed-zeros

2022-03-12  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
	PR middle-end/98420
	* match.pd (minus @0 @0): Additional checks for -fno-rounding-math
	(the defaut) or -fno-signed-zeros.

gcc/testsuite/ChangeLog
	PR middle-end/98420
	* gcc.dg/pr98420.c: New test case.
2022-03-12 09:20:52 +00:00
c++tools
config
contrib Daily bump. 2022-03-11 00:16:39 +00:00
fixincludes
gcc PR middle-end/98420: Don't fold x - x to 0.0 with -frounding-math 2022-03-12 09:20:52 +00:00
gnattools
gotools
include
INSTALL
intl
libada
libatomic
libbacktrace
libcc1
libcody
libcpp
libdecnumber
libffi
libgcc Daily bump. 2022-03-10 00:16:28 +00:00
libgfortran
libgo
libgomp Daily bump. 2022-03-11 00:16:39 +00:00
libiberty
libitm
libobjc
liboffloadmic
libphobos Daily bump. 2022-03-12 00:16:27 +00:00
libquadmath
libsanitizer
libssp
libstdc++-v3 Daily bump. 2022-03-11 00:16:39 +00:00
libvtv
lto-plugin Daily bump. 2022-03-12 00:16:27 +00:00
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2022-03-10 00:16:28 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure
configure.ac
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def toplevel: Makefile.def: Make configure-sim depend on all-readline 2022-03-09 20:54:37 +01:00
Makefile.in toplevel: Makefile.def: Make configure-sim depend on all-readline 2022-03-09 20:54:37 +01:00
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README * README: Document use of ranges of years in copyright notices. 2012-07-16 15:01:34 +01:00
symlink-tree
test-driver
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.